I have this script and it works perfectly in test mode but in a roblox game server it doesn't.

script.Parent.ClickDetector.MouseClick:connect(function(player)
	player.PlayerGui.ScreenGui.TextButton.Visible = true
	script.Parent.Parent.Parent.ValueA.Value = script.Parent.Parent.Parent.ValueA.Value-1
	script.Parent:Remove()
end)

The part with this script is getting cloned. If that means anything.

The parent of this script is a part which also holds a clickdetector. And this part is getting cloned every two seconds.

7 comments

1

There's not enough context here to solve your issue - what is script.Parent.Parent.Parent? How did you get the player variable? Does it not work as in it's giving an error, or isn't doing anything?

0

If you have filtering enabled on (might be for non FE too), I have found that the server can't communicate with any child objects in the player's folders such as playerGui. My suggestion is to use remote functions or events to tell the client to do the work the server wants to do

1

craftsmanbuild has a valid point since sometimes if FE is on code will work on studio but not in the main game. Check the properties of workspace and look for filtering enabled. Make sure its turned off

0

windstrike delete your comment.... filtering is supposed to be enabled.

0

Lol, leave FE on.

0

The parent of this script is a part which also holds a clickdetector. And this part is getting cloned every two seconds. I got the player variable from that clickdetector.

0

LOOK, THIS IS ALL I HAVE! THERES NOTHING MORE IN THE SCRIPT!