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

Mouse button 1 click is Hard. Who can help me?

Asked by 5 years ago
Edited 5 years ago

Problem: It kept on saying line 1 code has an error

Purpose of this script: Making Class Load outs GUI

Well I put this script in a Local script, I was making a class load out script like I copy in this video

Link:** https://www.youtube.com/watch?v=gG8H_dbnA8o**

Their was an error, I tried to fix it what ever I do it just makes/ making errors

Script:

script.Parent.MouseButton1Click:connect(function()
    local Fire = game.ReplicatedStorage.Weapons
    Fire:FireServer(script.Parent.Parent.Loadout.Value)
    script.Parent.Parent:TweenPosition(UDim2.New(2,0,.1,0),"Out","Quad", 1)
end)

line 1 is my problem here guys. Also this script/Local script is in a Text Label.

0
what does the error say? Ido_nothaveUsername 213 — 5y
0
'Players.Kyle_TPD.PlayerGui.ScreenGui.Frame.Confirm.LocalScript', Line 1 Kyle_TPD 0 — 5y
0
It's Connect not connect by the way Shawnyg 4330 — 5y
0
That's not the full error... MachoPiggies 526 — 5y

1 answer

Log in to vote
-1
Answered by 5 years ago

Your issue on line 1 is that the function for detecting mouse clicking isn't called MouseButton1Click, it's called MouseButton1Down so all you would have to do is:

script.Parent.MouseButton1Down:Connect(function()
    -- Put the code here for the function
end)
0
aw..... okay Kyle_TPD 0 — 5y
Ad

Answer this question