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

What is wrong with this script? [SOLVED]

Asked by
xancor1 10
11 years ago
01local player = game.Players.LocalPlayer
02local mouse = player:GetMouse()
03 
04 local open = false
05 
06mouse.KeyDown:connect(function(key)
07    if key == "q" then
08        if open == false then
09            open = true
10                script.Parent.ShopFrame.Visible = true
11        elseif open == true then
12            open = false
13                script.Parent.ShopFrame.Visible = false
14        end
15    end
16end

I have tried to fix it but i cant find out what is wrong

1 answer

Log in to vote
1
Answered by 11 years ago

You forgot the end parenthesis at the end on line 4

01local player = game.Players.LocalPlayer
02local mouse = player:GetMouse()
03 
04local open = false
05 
06mouse.KeyDown:connect(function(key) --The open parenthesis before the "function" needs to be closed
07    if key == "q" then
08        if open == false then
09            open = true
10                script.Parent.ShopFrame.Visible = true
11        elseif open == true then
12            open = false
13                script.Parent.ShopFrame.Visible = false
14        end
15    end
16end) --There was no parenthesis here

Like my answer if you found it useful!

0
oh, Thanks! xancor1 10 — 11y
0
is there any way that i could make the mouse able to move while it is open (My game is locked in first person) xancor1 10 — 11y
0
I'm pretty sure you can just right click while your mouse is over the GUI, and it will unlock the mouse TurboFusion 1821 — 11y
0
If you're stuck in first person, and your mouse won't move, then press ESC TurboFusion 1821 — 11y
View all comments (2 more)
0
i cant move my mouse onto the GUI, it is at the side of the screen xancor1 10 — 11y
0
but i can just move the gui to the middle xancor1 10 — 11y
Ad

Answer this question