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

What is wrong with this script [HELP?] [closed]

Asked by 8 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

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.

0
Put it in a code block. KennySfromTitan 106 — 8y
0
What's it supposed to do? What does it do instead? Is there any output? Have you done any debugging yourself? BlueTaslem 18071 — 8y

Closed as Too Broad by Goulstem and YellowoTide

This question has been closed because it is too broad and is generally unanswerable. Please ask a more specific question.

Why was this question closed?

1 answer

Log in to vote
0
Answered by 8 years ago

Please provide explanation with your answers. Simply posting code does not spread knowledge of integral scripting processes which helps people understand the logic and reasoning behind your 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
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. BlueTaslem 18071 — 8y
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? TheDeadlyPanther 2460 — 8y
Ad