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

Script Not working not cloning gun into players backpack?

script.Parent.MouseButton1Click:connect(function() if game.Players.LocalPlayer.Equipment.PrimaryGun.value == "Startergun" then do game.ServerStorage.Guns.Startergun:Clone().Parent = game.Players.LocalPlayer.Backpack

end

1 answer

✓ Accepted answer

The "V" In Value is UpperCase not LowerCase

(Also remember Lua Is Case Sensitive)

Also the "Do" Is not necessary

script.Parent.MouseButton1Click:connect(function() 
if game.Players.LocalPlayer.Equipment.PrimaryGun.Value == "Startergun" then
game.ServerStorage.Guns.Startergun:Clone().Parent = game.Players.LocalPlayer.Backpack
end

2 comments

0

thanks i was tired and could not find the error

0

No problem

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