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

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

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.

4 comments

0

what does the error say?

0

'Players.Kyle_TPD.PlayerGui.ScreenGui.Frame.Confirm.LocalScript', Line 1

0

It's Connect not connect by the way

0

That's not the full error...

1 answer

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)

1 comment

0

aw..... okay

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