-
What do you want to achieve? A button that gives ONE weapon
-
What is the issue? Button gives multiple weapons.
-
What solutions have you tried so far? Editing the code and looking on the Dev Forum
My code that gives one weapon:
local Event = game.ReplicatedStorage:WaitForChild(“RemoteEvent”)
local Tool = game.ServerStorage:WaitForChild(“BeginnerWand”)
Event.OnServerEvent:Connect(function(Player)
local ToolClone = Tool:Clone()
ToolClone.Parent = Player.Backpack
local ToolClone = Tool:Clone()
ToolClone.Parent = Player.StarterGear
end)
My code that gives the other Weapon:
local Event = game.ReplicatedStorage:WaitForChild(“RemoteEvent”)
local Tool = game.ServerStorage:WaitForChild(“Bow”)
Event.OnServerEvent:Connect(function(Player)
local ToolClone = Tool:Clone()
ToolClone.Parent = Player.Backpack
local ToolClone = Tool:Clone()
ToolClone.Parent = Player.StarterGear
end)
This code is in the starterGui for both weapons:
local RemoteEvent = game.ReplicatedStorage:WaitForChild(“RemoteEvent”)
local Button = script.Parent
Button.MouseButton1Down:Connect(function()
RemoteEvent:FireServer()
Button.Parent.Visible = false
end)
Please leave feedback Thank you for reading this and if you helped also thank you!!!