I created a game launcher which I did in localscript. Now I need to program regular scripts as a regular script type. The problem is that localscript and the script will run at the same time. Here is a (simple) game start script:
script.Parent.MouseButton1Click:Connect(function() script.Parent.Parent.Visible = false end)
Perhaps the easiest solution would be to wait a few seconds, **but the player could wait a while before pressing a button. **
so this is the situation. I hardly program (I'm better at building models) and now I need a script for my game for friends. I've been trying to solve this problem for a few days but I couldn't. Greetings KotyOceloty
Just add a remote event. In replicated storage, Put a remote event and then use this as your local script
script.Parent.MouseButton1Click:Connect(function() script.Parent.Parent.Visible = false game:GetService("ReplicatedStorage"):FindFirstChild("RemoteEvent"):FireServer() -- fires server event end)
So you will fire the event from the local script. And then in your script. You can just do
game:GetService("ReplicatedStorage"):FindFirstChild("RemoteEvent").OnServerEvent:Connect(function() -- fire server when server event fired wait('Put your time in here') -- you dont need this. but you phrased it like you wanted it to wait a second so you can use it if you want --script here end)
let me know if i did something wrong or i read it wrong