Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

how to put the leaderboard of a player (made by a script and add it to another script?

Asked by 14 days ago

I have been trying to do this but it always crushes my studio

local ReplicatedStorage = game:GetService("ReplicatedStorage") local remoteEvent = ReplicatedStorage:WaitForChild("RemoteEventTest")

local function bought () local plr = game:GetService("Players") local me = game.Players.LocalPlayer print("doingfine") if me.leaderstats.Gold.Value >= 1000 then plr.leaderstats.Gold.Value = plr.leaderstats.Gold.Value - 1000 local me = game.Players.LocalPlayer local coil = game.ServerStorage.SpeedCoil coil.Parent = me.StarterPack print("executed") end end

remoteEvent.OnServerEvent:Connect(bought)

0
Well, first of all, the title is kinda confusing, and I still don't get what you are trying to do. Nonetheless, you can't use localplayer and try to get serverstorage in the same script. DarkDanny04 391 — 14d

Answer this question