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

im not so sure what to do here someone help me?

Asked by 8 years ago

When i reset the character the script only prints up to line 18 which is Varaibles

i tried waiting for the character but it doesnt work help?

local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:wait()
local backpack = plr.Backpack
local light = game.Lighting
local safe = script.Parent.Parent:FindFirstChild('IsSafe')



local deb = false
script.Parent.MouseButton1Click:connect(function(press)
    if deb then return end
    deb = true
    print '1'
        local h = char:WaitForChild('Humanoid')
        local he = char:WaitForChild('Head')
        local n  = plr.Name
        local ch = char:GetChildren()
        print 'Varaibles'

        if safe then
        if safe.Value == false then
            safe.Value = true
            print 'turning on safe mode'

            script.Parent.Text = "Turn Off Roleplay Mode"

            local to = backpack:GetChildren()--Takes tools inside a model in lighting Names it players Name     
            store = nil
            for x = #to, 1, -1 do
                if (to[x]:isA("Tool")) then
                    if store == nil then
                    store = Instance.new("Model",light)
                    end
                    store.Name = "" ..plr.Name
                    to[x].Parent = store
                    end
            end
            print 'tools taken'


            h.MaxHealth = math.huge
            h.Health = math.huge








        elseif safe.Value == true then
            safe.Value = false
            script.Parent.Text = "Turn On Roleplay Mode"
            print 'turning off safe mode'


        --[[for x = #ch, 1, -1 do
            if (ch[x]:isA("Model")) then
                ch[x]:destroy()
            end
        end--]]

        h.MaxHealth = 100
        h.Health = 100
        he.Transparency = 0

        local re = light:FindFirstChild("" ..plr.Name)
        if re then
            local ret = re:GetChildren()
            for i = #ret, 1, -1 do
                ret[i].Parent = backpack
            end
        end
        light["" ..plr.Name]:Destroy()
        print 'given back tools'









        end 


        end
        wait(5)
    deb = false


end)


2 answers

Log in to vote
1
Answered by 8 years ago

On the bottom the h can be included. but the he is not. the code is here.

game.Workspace.("Example").Transparency = (Number)
--Remember. the he is not included. game.Workspace is included.
h.MaxHealth = 100
--Remember the math.huge is not gonna work.
--same with h.Health.
0
Thats not the case, the script stops at line 18 i dont know how this is gonna help xlaser23 60 — 8y
Ad
Log in to vote
0
Answered by
lukedm 0
8 years ago

Try making a variable for the print text.

0
....? xlaser23 60 — 8y

Answer this question