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

Script working in studio but not in roblox, happened two times already?

Whats wrong with it?????

script.Parent.Touched:Connect(function(hit)
	if hit.Parent:FindFirstChild("Humanoid") then
		local playercharacter = hit.Parent.Name
		local player = game.Players:FindFirstChild(playercharacter)
		local gui = player.PlayerGui.FinallyWater
		gui.Enabled = true
	end
end)

2 answers

Maybe you're using the wrong type of script, such as a ModuleScript or a LocalScript.

1 comment

0

im using a normal script

Do you have Filtering Enabled on? If so, the server cannot look inside the Player's Gui folder to enable the FinallyWater gui. The reason it is working in studio is because you are probably using the normal testing mode, where the client and server are the same thing, thus enabling the server to access the client's PlayerGui folder.

The best way to test your games when using FE, as everybody should be, is to create the local server under the testing tab. If you do this, the script probably won't be working.

The best way to handle the task you're trying to accomplish is with RemoteEvents, which you can find help on here.

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