Hi, I made a image button, in starter gui. When I was in studio the image button worked perfectly fine, but when I went to a test server, the image button wasnt doing anything when I clicked it.
why?
Here is my script in the image button
local player = game.Players.LocalPlayer
local character = player.CharacterAdded:wait()
local lore = player.PlayerGui.ChooseCharacter.Background.Zeus.Lore.TextLabel
local gui = player.PlayerGui.ChooseCharacter
local God = player.PlayerGui.ChooseCharacter.God
local button = player.PlayerGui.ChooseCharacter.Background.Zeus
button.MouseButton1Click:Connect(function()
gui.Background.Visible = false
game.StarterPlayer.EnableMouseLockOption = true
lore.Visible = false
God.Value = "Zeus"
character.UpperTorso.CFrame = CFrame.new(182, 0.5, 39)
end)

12 comments
is it a local script
yes
RBXScriptSignal:wait() is deprecated, it is RBXScriptSignal:Wait()
wait() is deprecated??? so from now on I just use Wait()
i edited it
I cant add a click detector....
dont use a click detector
You can't change EnableMouseLockOption's value in a LocalScript unless you only want to change it for your player, if you want it to replicate to all clients then you need to use a RemoteEvent.
oh ok I removed EnableMouseLockOption, btw @stinkyest11 your script didnt work
What I said is also true for other parts of your script, including changing the CFrame of the UpperTorso, unless you don't want it to appear on everyone's screen.
@MythicalShade wait I thought only one players CFrame would change since its a local script
Only one player's CFrame will change with a local script, I mean that everyone will see that the player has moved, instead of only the player that moved seeing that he moved. (Sorry if it's confusing, but I'd look at my answer.)