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

This script only works in test mode, help?

Asked by
L43Q 48
9 years ago

This is a local script.

So I have this simple script that changes the text of a textlabel (script.Parent.Frame.HP) to the value which is located at game.ServerStorage.PlayerStats(player's name).HP.Value

This value is a number.

local player = game.Players.LocalPlayer

while true do
    wait(.5)
    script.Parent.Frame.HP.Text = game.ServerStorage.PlayerStats:FindFirstChild(player.Name).HP.Value
end

For some reason, the script only works in testing mode (F5) where it spawns a character, but it doesn't work on the actual game.

0
line 5 was too big to fit on the page, so it's spread out on two lines. It's not like this on the script. L43Q 48 — 9y
0
Local script can't access ServerStorage in online mode for security reasons. Mokiros 135 — 9y
0
Oh, thanks. L43Q 48 — 9y
0
I've changed it to lighting. Works well now, thanks! L43Q 48 — 9y

Answer this question