So I have this shop and the gear is only on my screen my friend showed me a screenshot and every gear given to me is only on my screen and on his end it's just me holding my arm out with nothing in my hand.
Here is the code -
local player = game.Players.LocalPlayer script.Parent.MouseButton1Click:Connect(function() if player.leaderstats.Coins.Value >= 1000 then player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - 1000 local clonar = game.ReplicatedStorage.SpeedCoil:Clone() clonar.Parent = player.Backpack end end)
any help would be appreciated!
Make a script that will be in ServerScriptService and a RemoteEvent called "Buy"
local script:
local player = game.Players.LocalPlayer script.Parent.MouseButton1Click:Connect(function() if player.leaderstats.Coins.Value >= 1000 then player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - 1000 game.ReplicatedStorage.Buy:FireServer(game.ReplicatedStorage.SpeedCoil) end end)
Script:
game.ReplicatedStorage.Buy.OnServerEvent:Connect(function(Player, Item) Item:Clone().Parent = Player.Backpack end)