im not so sure what to do here someone help me?
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?
01 | local plr = game.Players.LocalPlayer |
02 | local char = plr.Character or plr.CharacterAdded:wait() |
03 | local backpack = plr.Backpack |
04 | local light = game.Lighting |
05 | local safe = script.Parent.Parent:FindFirstChild( 'IsSafe' ) |
10 | script.Parent.MouseButton 1 Click:connect( function (press) |
11 | if deb then return end |
14 | local h = char:WaitForChild( 'Humanoid' ) |
15 | local he = char:WaitForChild( 'Head' ) |
17 | local ch = char:GetChildren() |
21 | if safe.Value = = false then |
23 | print 'turning on safe mode' |
25 | script.Parent.Text = "Turn Off Roleplay Mode" |
27 | local to = backpack:GetChildren() |
30 | if (to [ x ] :isA( "Tool" )) then |
32 | store = Instance.new( "Model" ,light) |
34 | store.Name = "" ..plr.Name |
41 | h.MaxHealth = math.huge |
51 | elseif safe.Value = = true then |
53 | script.Parent.Text = "Turn On Roleplay Mode" |
54 | print 'turning off safe mode' |
67 | local re = light:FindFirstChild( "" ..plr.Name) |
69 | local ret = re:GetChildren() |
70 | for i = #ret, 1 , - 1 do |
71 | ret [ i ] .Parent = backpack |
74 | light [ "" ..plr.Name ] :Destroy() |
75 | print 'given back tools' |