Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

is there any way to make a script that finds players name?

Asked by 4 years ago

ok so im making a single player tycoon and im trying to make a script that adds cash from ore to player directly. This is my current script and for some reason it doesnt work.

wait(2)
local LocalPlr = game.Players.LocalPlayer.Name
local furnace = script.Parent
furnace.Touched:Connect(function(hit)
    if hit.Cash ~= nil then
        multiplier = script.Parent.Parent.Multiplier.Value
        game.Players.LocalPlr.leaderstats.Cash.Value = game.Players.LocalPlr.leaderstats.Cash.Value + hit.Cash.Value * multiplier
        wait(0.1)
        hit.BrickColor = BrickColor.new("Dark stone grey")
        wait(0.1)
        hit.BrickColor = BrickColor.new("Really black")
        wait(0.1)
        hit:Destroy()
    end
end)
0
"LocalPlayer" can only be used in LocalScripts, what you can do is store the player's name in a StringValue inside of their tycoon that you can reference as the owner of that tycoon. MegaManSam1 207 — 4y
0
im gonna try that TFlanigan 86 — 4y

Answer this question