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

Why doesn't it work when executed from server script?

Asked by 5 years ago

Well, here's a code i copied from somewhere in Internet:

for _, c in pairs(game.Players:GetChildren()) do
local hum = c.Character:WaitForChild('Humanoid') 
hum.Health = 0 end

This is code to kill every player in server. Well IT DOES WORK, but... i tested in Command bar input in studio, but when i connected it to a function, and then Roblox does just ignore the script. Well this function works, because other scripts in this function works, but this one doesn't run. Maybe i should execute it from a LocalScript? Also, it can be just a bug. But remember! 1. The function works properly and runs 2. The script does work and i tested it 3. This is in a Server script! What do I do? Please, help!

0
are you calling the function after assigning it? starmaq 1290 — 5y
0
yes. everything works. I said that scripts in the function works, except this one. But the script itself works good diamindhunter82 0 — 5y

Answer this question