Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 6 years ago

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

Log in to vote
0
Answered by 6 years ago

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

0
im using a normal script SuperBeeperman 30 — 6y
Ad
Log in to vote
0
Answered by 6 years ago

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.

Answer this question