Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

What is wrong with this script [HELP?]

while true do --if script.Parent == "PlayerGui" then plr = game.Players.LocalPlayer char = plr.Character --hum = char:WaitForChild("Humanoid") CreateAClass = plr:WaitForChild("CreateAClass")

rehum = char:FindFirstChild("Humanoid") health = rehum.Health if health >= 0 then local Lethals = CreateAClass:FindFirstChild("Lethals") local Tacticals = CreateAClass:FindFirstChild("Tacticals")

if Lethals then Lethals.Value = 2 end

if Tacticals then Tacticals.Value = 2 end

end --end

wait(.1) end

Can you fix this script please, not sure whats wrong with it.

2 comments

0

Put it in a code block.

0

What's it supposed to do? What does it do instead? Is there any output? Have you done any debugging yourself?

1 answer

I deciphered your post, and this is what I came out with. Is this right? And why doesn't this work? I will edit this post when you tell me.

local plr = game.Players.LocalPlayer
local char = plr.Character
local hum = char:WaitForChild("Humanoid")
local CreateAClass = plr.PlayerGui:WaitForChild("CreateAClass")
local rehum = char:FindFirstChild("Humanoid")
local health = rehum.Health

while true do 
	if script.Parent == "PlayerGui" then
		if health >= 0 then 
			local Lethals = CreateAClass:FindFirstChild("Lethals")
			local Tacticals = CreateAClass:FindFirstChild("Tacticals")
			if Lethals ~= nil then
				Lethals.Value = 2
				if Tacticals ~= nil then
					Tacticals.Value = 2
				end
			end
		end
	end
	wait(.1)
end

2 comments

0

What did you do? A good answer explains what was wrong, why it was wrong, and how you figured out what the right thing was.

0

Sorry, but this stupid website won't let me comment, because I started off with a -5 rating (idk why), so I still can't comment. I will remove it if you like?

This discussion is preserved as it was. New answers, comments, and votes are closed.