I have a store ingame that is purchased with tools.
How do I get this Tool to be visible with everyone in game
Everytime I try, its not working
The code has a intvalue named Price and a String Value for the name
There is a Remote event in Replicated Storage called 'GiveTool'
local player=game.Players.LocalPlayer
local leaderboard=player:WaitForChild("leaderstats")
local button=script.Parent
local price=button:WaitForChild("Price")
local item=button:WaitForChild("ItemName")
local rs=game:GetService("ReplicatedStorage")
local createPartEvent = rs:WaitForChild("GiveTool")
button.MouseButton1Click:connect(function()
if leaderboard.Coins.Value>=price.Value then
leaderboard.Coins.Value=leaderboard.Coins.Value-price.Value
local item=rs:WaitForChild(item.Value)
item:Clone().Parent=player.StarterGear
item:Clone().Parent=player.Backpack
end
end)
while wait()do
button.Text=item.Value.."-"..price.Value
end
