I used a local script for this:
function onButtonClicked() wait(0.1) game.Players.LocalPlayer:LoadCharacter() game.Players.LocalPlayer.PlayerGui.Bloxikin.Frame.Visible = false game.Players.LocalPlayer.PlayerGui.Flash.LocalScript.Disabled = false end script.Parent.MouseButton1Down:connect(onButtonClicked)
The button works fine when I test it in studio mode, but it doesn't work when I play the game... Help please?
Most of the time when people can't get things to work in Online mode that work in Studio, it's because they're using the wrong kind of script. Same case here.
Now, to fix the problem we would need to change this into a normal Script. The only problem with this is that you're not going to be able to access LocalPlayer
. Here's a simple way to get around this:
1. Add an ObjectValue, and put this LOCALSCRIPT inside it:
script.Parent.Value = game.Players.LocalPlayer
2. Add a SCRIPT with the same parent as the ObjectValue. Now, put this code into the script:
repeat wait() until script.Parent.ObjectValue.Value --Waits to set 'Player' until it is found Player = script.Parent.ObjectValue.Value function onButtonClicked() wait(0.1) Player:LoadCharacter() Player.PlayerGui.Bloxikin.Frame.Visible = false Player.PlayerGui.Flash.LocalScript.Disabled = false end script.Parent.MouseButton1Down:connect(onButtonClicked)
Now, this should work if you do it correctly. If you have any further questions, or I made a mistake, let me know in the comments. Hope I helped :P