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

Script says that my leaderstats (Traven) is 1 but it's 3?

Asked by
Troevan -8
1 year ago
Edited 1 year ago

https://www.youtube.com/watch?v=R8W6T4wMSl4

my script,

Script type: normal script because it's a 1 player game.

local tra = game.Players.LocalPlayer.leaderstats.traven.Value
local human = game.Players.LocalPlayer.Name
script.Parent.MouseButton1Click:Connect(function()
if tra == 1 then
        print("1")
end
if tra == 2 then
game.Lighting["2"].Parent = game.Workspace
wait(0.01)
game.Workspace["1"].Parent = game.Lighting
end
    if tra == 3 then
        game.Lighting["3"].Parent = game.Workspace
        wait(0.01)
        game.Workspace["1"].Parent = game.Lighting
    end
    if tra == 4 then
        game.Lighting["4"].Parent = game.Workspace
        wait(0.01)
        game.Workspace["1"].Parent = game.Lighting
    end
    if tra == 5 then
        game.Lighting["5"].Parent = game.Workspace
        wait(0.01)
        game.Workspace["1"].Parent = game.Lighting
    end
end)

it does the same ingame too, not just studio.

0
I don't understand ???? MattVSNNL 620 — 1y
0
do you have any other scripts that is using the traven too? T3_MasterGamer 2189 — 1y
0
yes, at the end of each level is a button that you press where traven turns to 1,2,3,4,5 depending on the level Troevan -8 — 1y
0
You say that's a normal script, but normal scripts cant use LocalPlayer, only local scripts can use LocalPlayer. I don't really understand your question. Just so you know, using local scripts sets things on the client's sides, and normal scripts sets things on the server's side (If that makes sense). kodymarcey 49 — 1y
0
But what is the point of it being client side if it's a 1 player game? Troevan -8 — 1y

4 answers

Log in to vote
0
Answered by 1 year ago

I am not too sure that this will solve what you need,

Maybe try

if tra == 1 then
        print("1")
end
if tra == 2 then
game.Lighting["2"].Parent = game.Workspace
wait(0.01)
game.Workspace["1"].Parent = game.Lighting
print("2")
end
    if tra == 3 then
        game.Lighting["3"].Parent = game.Workspace
        wait(0.01)
        game.Workspace["1"].Parent = game.Lighting
        print("3")
    end
    if tra == 4 then
        game.Lighting["4"].Parent = game.Workspace
        wait(0.01)
        game.Workspace["1"].Parent = game.Lighting
        print("4")
    end
    if tra == 5 then
        game.Lighting["5"].Parent = game.Workspace
        wait(0.01)
        game.Workspace["1"].Parent = game.Lighting
        print("5")
    end
end)
0
Nope Troevan -8 — 1y
Ad
Log in to vote
0
Answered by
Troevan -8
1 year ago

Hey guys i got it working, i just replaced tra with game.Players.LocalPlayer.leaderstats.traven.Value, im not the best with scripting but i think it was because it was only looking at traven once and not "refreshing"

Log in to vote
0
Answered by
Troevan -8
1 year ago

Hey guys i got it working, i just replaced tra with game.Players.LocalPlayer.leaderstats.traven.Value, im not the best with scripting but i think it was because it was only looking at traven once and not "refreshing"

Log in to vote
0
Answered by
enes223 327 Moderation Voter
1 year ago

hey you! have you ever heard of enes? if you are in trouble, better call enes!

Answer this question