captainm Posted November 9, 2015 Share Posted November 9, 2015 I want to listen for event when player joinin. So I code this in modmain.luaWhen I start the game as common server(no dedicated), and there are homesigns in the world, I'll get the print "playeractivated". But if I start the game as dedicated server,(also the world has homesigns) when I join in the server as client ,I got " ListenForEvent(playeractivated)" printed at Server end, but no "playeractivated". I don't know why.. Dedicated server's TheWorld won't push "playeractivated" event? Or client player's joinin won't trigger the event? local function AddListenEvent(inst) if GLOBAL.TheWorld.ismastersim then inst:ListenForEvent("playeractivated", function(inst,player) print "playeractivated" end, GLOBAL.TheWorld) ---work properly in common server ,why not in dedicated server? print "ListenForEvent(playeractivated)" end AddPrefabPostInit("homesign", AddListenEvent) Link to comment Share on other sites More sharing options...
Kzisor Posted November 9, 2015 Share Posted November 9, 2015 @captainm, ms_playerjoined Link to comment Share on other sites More sharing options...
captainm Posted November 9, 2015 Author Share Posted November 9, 2015 @Kzisor , it works~ ,thanks a lot~ Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now