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

A keydown script not working?

Asked by 7 years ago
Edited 7 years ago
local MyMouse = game.Players.LocalPlayer:GetMouse()

MyMouse.KeyDown:connect(function(key)
if string.lower(key) == "g" and if game.Players.LocalPlayer.PlayerGui.Value==3 then 
script.Parent.Chest.Ball1.Transparency=0
script.Parent.Chest.Ball2.Transparency=0
script.Parent.Chest.Ball3.Transparency=0
script.Parent.Chest.Ball4.Transparency=0
script.Parent.Chest.Ball5.Transparency=0
script.Parent.Chest.Ball6.Transparency=0
script.Parent.Chest.Ball7.Transparency=0
script.Parent.Chest.Ball8.Transparency=0
script.Parent.Chest.Ball9.Transparency=0
script.Parent.Chest.Ball10.Transparency=0
script.Parent.Chest.Ball11.Transparency=0
script.Parent.Chest.Ball12.Transparency=0
script.Parent.Chest.Ball13.Transparency=0
script.Parent.Chest.Ball14.Transparency=0
script.Parent.Chest.Ball15.Transparency=0
script.Parent.Chest.Ball16.Transparency=0
script.Parent.Chest.Ball17.Transparency=0
script.Parent.Chest.Ball18.Transparency=0
script.Parent.Chest.Ball19.Transparency=0
script.Parent.Chest.Ball20.Transparency=0
script.Parent.Chest.Ball21.Transparency=0
script.Parent.Chest.Ball22.Transparency=0
while string.lower(key) == "g" do
wait(1)
end
end
end)

2 answers

Log in to vote
0
Answered by
AmWrath 41
7 years ago

"if string.lower(key) == "g" and if" .. really? the "and" implies you are going to add to the if statement, delete it and see if your script works.

Ad
Log in to vote
0
Answered by
ferano 0
7 years ago

Delete the second if that follows and

Answer this question