Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

CharacterAdded script now working for some reason. Help?

I have this portion of my script:

player.CharacterAdded:connect(function(character)
print("I like bananas")
	character:WaitForChild("UpdateHealth"):FireClient(player)
end)

It's in a LocalScript It won't work for some reason. And It won't even fire the print line. What's wrong with it?

1 answer

✓ Accepted answer

It probably won't help but why are you using a RemoteEvent instead of a BindableEvent? Change the UpdateHealth RemoteEvent to a BindableEvent and then change the recieving end of the event to:

script.Parent:WaitForChild("UpdateHealth").Event:connect(function()
	-- Run your code here
end)

And change the firing script to:

player.CharacterAdded:connect(function(character)
print("I like bananas")
    character:WaitForChild("UpdateHealth"):Fire()
end)

2 comments

0

Also, use Connect not connect

0

Thanks!

This discussion is preserved as it was. New answers, comments, and votes are closed.