What i am trying to do is make a game where you can choose your class and you recieve those weapons. You start off with no items but when you click the gui it will give you that specified classes weapons. here is the order i want it to be in.
1:Player clicks the gui. 2:destroy the current gear in players backpack. 3:give the player the specified gear for that class.
over a 2 week span from when i first joined this site i knew nothing about scripting but now i am learning very well from tutorials and observing scripts from free models. the gui is correctly displayed and it allows you to click it but it is not destroying the current gear nor giving that gear. here is my script.
-- these two paragraphs are just the guis
local screenGui = Instance.new("ScreenGui")
screenGui.Parent = script.Parent
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"
--once you click this it should destroy your current gear then give you the bow
textButton.MouseButton1Down:connect(function()
p = game.Players:GetPlayerFromCharacter(script.Parent)
if p == nil then return end
bow = game.ServerStorage.SnowAndArrow:clone()--Weapon name
if p.Backpack:FindFirstChild(bow.name)~= nil then return end
bow.Parent = p.Backpack
end)

1 comment
Anyone please? ):