Made a gui that when you click it, it will give your player that specific gear. Not working and followed the syntax errors? Mind if anyone take a look? I put the gear in server storage and referenced it correctly.
-- In a LocalScript in StarterGui: -- Create ScreenGui local screenGui = Instance.new("ScreenGui") screenGui.Parent = script.Parent -- Create TextButton local textButton = Instance.new("TextButton") textButton.Parent = screenGui textButton.Position = UDim2.new(0, 50, 0, 50) textButton.Size = UDim2.new(0, 140, 0, 60) textButton.TextColor3 = BrickColor.White().Color textButton.Style = 2 textButton.Text = "Marksman" -- Bind function to button click textButton.MouseButton1Click:connect(function(part) p = game.Players:GetPlayerFromCharacter(part.Parent) if p == nil then return end bow = game.ServerStorage.SnowAndArrow:clone() if p.Backpack:FindFirstChild(bow.Name) ~= nil then return end bow.Parent = p.Backpack end)
Do i have to put another end or? I just started scripting two weeks ago so pardon my stupidity but if you do really know how to fix it it would be nice to show it and how you did it so i can progress more in learning this language!
On line 17 where it says: MouseButton1Click, It needs to be MouseButton1Down. And also, you need to make an on-clicked function:
function onClicked() -- what ever you want to happen here end textButton.MouseButton1Down:connect(onClicked)
The MouseButton1Click event has no built in parameters, and it is for sure not a touched event, with a parameter equal to whatever did the touching.
Why would you even think that a Click event could ever give you a part parameter? It just doesn't make sense.
Read my answer here for how to get the Player in your situation.