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

Im trying to make a button that only runs when gameStarted is 1, but i'm getting this error?

local PlayerModule = require(game.Players.LocalPlayer.PlayerScripts:WaitForChild("PlayerModule")) local Controls = PlayerModule:GetControls() local gameStarted = game.ReplicatedStorage.gameStarted if gameStarted.Value == 1 then script.Parent.MouseButton1Click:Connect(function Controls:Enable() workspace.CurrentCamera.FieldOfView = 50 game.Players.LocalPlayer.CameraMode = 'LockFirstPerson' end) end

1 comment

0

The error im getting is Players.[me].PlayerGui.ScreenGui.deployButton.LocalScript:6: Expected '(' when parsing function, got 'Controls'

1 answer

✓ Accepted answer

You are doing script.Parent.MouseButton1Click:Connect(function wrong, here is how you do it:

script.Parent.MouseButton1Click:Connect(function() -- Add () (A space for parameter :p)

hope that helped

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