Scripting Helpers is winding down operations and is now read-only. More info→
Ad
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 3 years 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 407 — 3y

Answer this question