Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local player = game.Players.LocalPlayer
- script.Parent.MouseButton1Click:Connect(function()
- local templateno = tonumber(script.Parent.Parent.Name)
- local templatename = script.Parent.Parent.ToolName.Value
- local previousno
- local previousname
- if templateno ~=1 then
- previousno = templateno -1
- previousname = script.Parent.Parent.Parent:FindFirstChild(previousno).ToolName.Value
- else
- previousname = script.Parent.Parent.ToolName.Value
- end
- if player.OwnedItems:FindFirstChild(previousname) then
- local sidemenu = script.Parent.Parent.Parent.Parent.Parent.SideMenu
- sidemenu.ImageOftool.Image = script.Parent.Parent.ToolImageDisp.ImageLabel.Image
- sidemenu.ImageOftool.ImageColor3 = Color3.fromRGB(255,255,255)
- sidemenu.NameOftool.TextLabel.Text = script.Parent.Parent.ToolName.Value
- sidemenu.Cost.CostOfTool.Value = script.Parent.Parent.CostDisplay.Value
- sidemenu.Cost.CostDisplayer.Text = "Cost : "..sidemenu.Cost.CostOfTool.Value
- if player.Equipped.Value == script.Parent.Parent.ToolName.Value then
- sidemenu.BuyButton.TextButton.Text = "Equipped"
- elseif player.OwnedItems:FindFirstChild(templatename) then
- sidemenu.BuyButton.TextButton.Text = "Equip"
- else
- sidemenu.BuyButton.TextButton.Text = "Buy"
- end
- else
- local sidemenu = script.Parent.Parent.Parent.Parent.Parent.SideMenu
- sidemenu.ImageOftool.Image = script.Parent.Parent.ToolImageDisp.ImageLabel.Image
- sidemenu.ImageOftool.ImageColor3 = Color3.fromRGB(0,0,0)
- sidemenu.NameOftool.TextLabel.Text = "???"
- sidemenu.Cost.CostOfTool.Value = 0
- sidemenu.Cost.CostDisplayer.Text = "Cost : ???"
- sidemenu.BuyButton.TextButton.Text = "Can't Buy Now"
- end
- end)
Add Comment
Please, Sign In to add comment