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

error with NumberValue? [Edited]

Asked by 8 years ago

The purpose of this code is to run a block of code block. Unfortunately, Nothing happens, no errors. Any ideas on why this doesn't work? Code:

while true do
local plr = game.Players.LocalPlayer
local pack = plr.Backpack
local char = plr.Character
local gooey = plr.PlayerGui
local value = gooey["ToolMain_"].Value1
wait(.00000001)
for p, t in pairs(pack:GetChildren()) do
    if t.ClassName=="Tool" and t.Parent==pack and value.Value == 1 then
        t.Parent = char
    end
end
end
0
Well, here fireboltofdeath 635 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

Your code:

while true do
local plr = game.Players.LocalPlayer
local pack = plr.Backpack
local char = plr.Character
local gooey = plr.PlayerGui
local value = gooey.ToolMain_.Value
wait(.00000001)
for p, t in pairs(pack:GetChildren()) do
    if t.ClassName=="Tool" and t.Parent==pack and value.Value == 1 then
        t.Parent = char
    end
end
end

fixed code:

while true do
local plr = game.Players.LocalPlayer
local pack = plr.Backpack
local char = plr.Character
local gooey = plr.PlayerGui
local value = gooey["ToolMain_"]
wait(.00000001)
for p, t in pairs(pack:GetChildren()) do
    if t:IsA("Tool") and t.Parent==pack and value.Value == 1 then --Oh and if it doesn't work go ahead and try ClassName.
        t.Parent = char
    end
end
end
0
Tell me if it won't work fireboltofdeath 635 — 8y
0
It is not working, i get the fallowing error: 02:29:04.050 - ToolNaub_ is not a valid member of PlayerGui CrabEngineer -1 — 8y
0
OOps, mistake, Fixed it fireboltofdeath 635 — 8y
0
Still not working as intended, when i change the value from 0 to 1 nothing happens. CrabEngineer -1 — 8y
View all comments (5 more)
0
Any errors? fireboltofdeath 635 — 8y
0
No. None. CrabEngineer -1 — 8y
0
Go to the script, go to view at top, click script diagnostic, then click on warnings fireboltofdeath 635 — 8y
0
There is no warnings CrabEngineer -1 — 8y
0
Is the value in ToolMain set to 1? BinaryResolved 215 — 8y
Ad

Answer this question