Why is the call on character not working? Works in studio.
Asked by
7 years ago Edited 7 years ago
Error: https://gyazo.com/a7ff2d4e964399d807b57e841779423b
This script is in a tool that's inside a players backpack which is inside the player
Here's the code.
001 | local tool = script.Parent |
002 | local player = game:GetService( "Players" ).LocalPlayer |
004 | local clickDetecter 1 = Instance.new( "ClickDetector" ) |
005 | local clickDetecter 2 = Instance.new( "ClickDetector" ) |
006 | local clickDetecter 3 = Instance.new( "ClickDetector" ) |
007 | local clickDetecter 4 = Instance.new( "ClickDetector" ) |
008 | local clickDetecter 5 = Instance.new( "ClickDetector" ) |
009 | print (script.Parent.Parent.Parent.Character.Humanoid) |
010 | local humanoid = script.Parent.Parent.Parent.Character.Humanoid |
012 | local d = humanoid.Parent:GetChildren() |
013 | local e = game.ReplicatedStorage:GetChildren() |
021 | tool.Equipped:connect( function (mouse) |
024 | mouse.Button 1 Down:connect( function () |
025 | local brickColor 1 = game.ReplicatedStorage.colorsave:Clone() |
026 | brickColor 1. BrickColor = script.Parent.Parent.Torso.BrickColor |
027 | local brickColor 2 = game.ReplicatedStorage.colorsave:Clone() |
028 | brickColor 2. BrickColor = script.Parent.Parent:FindFirstChild( "Right Leg" ).BrickColor |
029 | local brickColor 3 = game.ReplicatedStorage.colorsave:Clone() |
030 | brickColor 3. BrickColor = script.Parent.Parent:FindFirstChild( "Right Arm" ).BrickColor |
031 | local brickColor 4 = game.ReplicatedStorage.colorsave:Clone() |
032 | brickColor 4. BrickColor = script.Parent.Parent:FindFirstChild( "Left Leg" ).BrickColor |
033 | local brickColor 5 = game.ReplicatedStorage.colorsave:Clone() |
034 | brickColor 5. BrickColor = script.Parent.Parent:FindFirstChild( "Left Arm" ).BrickColor |
035 | local brickColor 6 = game.ReplicatedStorage.colorsave:Clone() |
036 | brickColor 6. BrickColor = script.Parent.Parent.Head.BrickColor |
038 | brickColor 1. Parent = game.ReplicatedStorage |
039 | brickColor 1. Name = "torsoColor" |
040 | brickColor 2. Parent = game.ReplicatedStorage |
041 | brickColor 2. Name = "rightLegColor" |
042 | brickColor 3. Parent = game.ReplicatedStorage |
043 | brickColor 3. Name = "rightArmColor" |
044 | brickColor 4. Parent = game.ReplicatedStorage |
045 | brickColor 4. Name = "leftLegColor" |
046 | brickColor 5. Parent = game.ReplicatedStorage |
047 | brickColor 5. Name = "leftArmColor" |
048 | brickColor 6. Parent = game.ReplicatedStorage |
049 | brickColor 6. Name = "headColor" |
053 | script.Parent.Sound 2 :Play() |
054 | script.Parent.Parent.Shirt.Parent = game.ReplicatedStorage |
055 | script.Parent.Parent.Pants.Parent = game.ReplicatedStorage |
056 | local busoparticles = game.ReplicatedStorage.busoParticles:Clone() |
057 | busoparticles.Parent = script.Parent.Parent.Torso |
058 | local busoparticles 1 = game.ReplicatedStorage.busoParticles:Clone() |
059 | busoparticles 1. Parent = script.Parent.Parent:FindFirstChild( "Left Leg" ) |
060 | local busoparticles 2 = game.ReplicatedStorage.busoParticles:Clone() |
061 | busoparticles 2. Parent = script.Parent.Parent.Head |
062 | local busoparticles 3 = game.ReplicatedStorage.busoParticles:Clone() |
063 | busoparticles 3. Parent = script.Parent.Parent:FindFirstChild( "Left Arm" ) |
064 | local busoparticles 4 = game.ReplicatedStorage.busoParticles:Clone() |
065 | busoparticles 4. Parent = script.Parent.Parent:FindFirstChild( "Right Arm" ) |
066 | humanoid.MaxHealth = 400 |
067 | humanoid.Health = humanoid.Health* 4 |
070 | script.Parent.Parent.Head.BrickColor = BrickColor.Black() |
071 | script.Parent.Parent.Head.Reflectance = 0.4 |
072 | script.Parent.Parent.Torso.Reflectance = 0.4 |
073 | script.Parent.Parent.Torso.BrickColor = BrickColor.Black() |
074 | script.Parent.Parent:FindFirstChild( "Left Arm" ).BrickColor = BrickColor.Black() |
075 | script.Parent.Parent:FindFirstChild( "Left Arm" ).Reflectance = 0.4 |
076 | script.Parent.Parent:FindFirstChild( "Right Arm" ).BrickColor = BrickColor.Black() |
077 | script.Parent.Parent:FindFirstChild( "Right Arm" ).Reflectance = 0.4 |
078 | script.Parent.Parent:FindFirstChild( "Left Leg" ).BrickColor = BrickColor.Black() |
079 | script.Parent.Parent:FindFirstChild( "Left Leg" ).Reflectance = 0.4 |
080 | script.Parent.Parent:FindFirstChild( "Right Leg" ).BrickColor = BrickColor.Black() |
081 | script.Parent.Parent:FindFirstChild( "Right Leg" ).Reflectance = 0.4 |
082 | script.Parent.Parent.Humanoid.WalkSpeed = 10 |
085 | local d = humanoid.Parent:GetChildren() |
092 | script.Parent.Parent.Torso.BrickColor = game.ReplicatedStorage.torsoColor.BrickColor |
094 | game.ReplicatedStorage.Shirt.Parent = script.Parent.Parent |
095 | game.ReplicatedStorage.Pants.Parent = script.Parent.Parent |
096 | humanoid.Health = humanoid.Health/ 4 |
097 | humanoid.MaxHealth = 100 |
099 | script.Parent.Parent.Head.BrickColor = game.ReplicatedStorage.headColor.BrickColor |
100 | script.Parent.Parent.Head.Reflectance = 0 |
101 | script.Parent.Parent.Torso.Reflectance = 0 |
102 | script.Parent.Parent.Torso.BrickColor = game.ReplicatedStorage.torsoColor.BrickColor |
103 | script.Parent.Parent:FindFirstChild( "Left Arm" ).BrickColor = game.ReplicatedStorage.leftArmColor.BrickColor |
104 | script.Parent.Parent:FindFirstChild( "Left Arm" ).Reflectance = 0 |
105 | script.Parent.Parent:FindFirstChild( "Right Arm" ).BrickColor = game.ReplicatedStorage.rightArmColor.BrickColor |
106 | script.Parent.Parent:FindFirstChild( "Right Arm" ).Reflectance = 0 |
107 | script.Parent.Parent:FindFirstChild( "Left Leg" ).BrickColor = game.ReplicatedStorage.leftLegColor.BrickColor |
108 | script.Parent.Parent:FindFirstChild( "Left Leg" ).Reflectance = 0 |
109 | script.Parent.Parent:FindFirstChild( "Right Leg" ).BrickColor = game.ReplicatedStorage.rightLegColor.BrickColor |
110 | script.Parent.Parent:FindFirstChild( "Right Leg" ).Reflectance = 0 |
111 | script.Parent.Parent.Humanoid.WalkSpeed = 16 |