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

Why can't I delete the ControlScript in PlayerScripts?

I don't understand... Can someone help me?

game.Players.PlayerAdded:connect(function(plr)
	wait(2)
	plr.PlayerScripts.ControlScript:Destroy()
end)

I don't get why this doesn't work. Although it works in singleplayer test, it does not work on a server. It says that PlayerScripts is not a valid member of player. That's why I have the wait(2). At first i did this:

game.Players.PlayerAdded:connect(function(plr)
	plr:WaitForChild("PlayerScripts"):WaitForChild("ControlScript"):Destroy()
end)

No idea why, but it also doesn't work. It just says possible infinite yeild and never deletes the control script. Maybe it is something simple I am overlooking, either way, help me out. Thanks!

4 comments

0

Do you have filtering enabled on in workspace?

0

yes

0

that's the reason why

0

Server-Side scripts cannot access PlayerScripts when fe is on.

1 answer

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