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

Functions used in scripts within a tool do nothing?

I'm building my own magic game where the user says a word and the word is stored as a string value and executed with a different script. However, I tried using the PlayerAdded function and it does not work within a regular script in the tool. It works fine when I use it in workspace though. Is this actually a thing? Chatted and CharacterAdded don't work either. Here is my code, made it super simple for testing and nothing is working:

game:GetService("Players").PlayerAdded:connect(function(plr)
	print("Test")
end)

2 comments

0

Lmao it better be a local script

0

doesnt work in either

1 answer

✓ Accepted answer

I really hate PlayerAdded because it seems to me like it doesn't always work. Try using ChildAdded, which will tell you when anything is added as a child (Be sure to put a wait otherwise the character might not load in time)

game:GetService("Players").ChildAdded:connect(function(plr)
    print("Test")
end)

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