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

When I click buy it works but I need help on not being able to buy it again like cloning it?

game.ReplicatedStorage.ToolEvents.SpeedCoilEvent.OnServerEvent:Connect(function(player) if player.leaderstats.Money.Value >= 100 then player.leaderstats.Money.Value = player.leaderstats.Money.Value -100 game.ServerStorage.Tools.SpeedCoil:Clone().Parent = player.Backpack end end)

1 comment

0

put more detail

1 answer

local tool=game.ServerStorage.Tools.SpeedCoil
game.ReplicatedStorage.ToolEvents.SpeedCoilEvent.OnServerEvent:Connect(function(player)
local val=player.leaderstats.Money
if val.Value >= 100 and not player.StarterGear:FindFirstChild(tool.Name)then 
val.Value=val.Value-100 
tool:Clone().Parent=player.StarterGear
tool:Clone().Parent=player.Backpack 
	end 
end)

1 comment

0

Probably change the player.StarterGear to player.Backpack. Also, if you want them to have it when they respawn or rejoin, you can set up a datastore.

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