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

A script that acts like a local script?

Asked by 9 years ago

Help i don't know how to actually get into a player's leaderstats help?

while wait() do
if game.Players.LocalPlayer.Character.leaderstats.ChestPlate.Value == 1 then
    script.Parent.Transparency = 0
else
    script.Parent.Transparency = 1
end
end
0
What is this part? Why does it care about the level of the player? BlueTaslem 18071 — 9y
0
The LocalPlayer can't be accessed through a `Script`. woodengop 1134 — 9y

1 answer

Log in to vote
1
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
9 years ago

Looking at your script, I see you're changing a Part's Transparency. If you're going to target one player only, but don't know who it will be, you'd need to make it a LocalScript in StarterGui. Such as:

while wait() do
    if game.Players.LocalPlayer.Character.leaderstats.ChestPlate.Value == 1 then -- Just so you know, leaderstats is a child of LocalPlayer
        game.Workspace.Part.Transparency = 0
    else
        game.Workspace.Part.Transparency = 1
    end
end

However, you need to start to think that what if another Player doesn't meet the requirement, yet gets in the door? I won't make the script, but it involves putting parts in their CurrentCamera. Hope I helped! If I didn't, I apologize, but you didn't provide much of an explanation.

0
its a single player game but thanks anyways :3 Anthony9960 210 — 9y
Ad

Answer this question