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

this script works but this one dosent? While Both are the same?

Asked by 3 years ago

The script that dosent work

01local player = game.Players.LocalPlayer or game.Players.PlayerAdded:Wait()
02local character = player.Character or player.CharacterAdded:Wait()
03local part = script.Parent["Left Hand Glove"]
04local weld = Instance.new("Weld",part)
05local debounce = false
06weld.Part0 = part
07weld.Part1 = character["Left Arm"]
08 
09local tool = script.Parent
10 
11tool.Equipped:Connect(function() -- it just dosent give a signal like what
12    if not debounce then
13        character.Humanoid.MaxHealth = character.Humanoid.MaxHealth + 10
14        character.Humanoid.Health = character.Humanoid.Health + 10
15        debounce = true
16    end
17end)

the script that works

01local player = game.Players.LocalPlayer or game.Players.PlayerAdded:Wait()
02local character = player.Character or player.CharacterAdded:Wait()
03local part = script.Parent["Blocky Hat"]
04local weld = Instance.new("Weld",part)
05local debounce = false
06weld.Part0 = part
07weld.Part1 = character.Head
08 
09local tool = script.Parent
10 
11tool.Equipped:Connect(function()
12    if not debounce then
13        character.Humanoid.MaxHealth = character.Humanoid.MaxHealth + 50
14        character.Humanoid.Health = character.Humanoid.Health + 50
15        local hatclone = script.Parent["Blocky Hat"]:Clone()
16        hatclone.Parent = character.Head       
17        debounce = true
18    end
19end)

both scripts go in tools

1 answer

Log in to vote
1
Answered by 3 years ago
Edited 3 years ago
01local player = game.Players.LocalPlayer or game.Players.PlayerAdded:Wait()
02local character = player.Character or player.CharacterAdded:Wait()
03part = script.Parent["Left Hand Glove"]
04local debounce = false
05 
06local tool = script.Parent
07 
08tool.Equipped:Connect(function()
09    if character.Humanoid.RigType == Enum.HumanoidRigType.R15 then
10        local weld = Instance.new("Weld",part)
11        weld.Part0 = part
12        weld.Part1 = character["LeftHand"]
13    else
14        local weld = Instance.new("Weld",part)
15        weld.Part0 = part
View all 23 lines...

Ive edited the script that does nothing on studio and now it works

0
it like dosent detect when the player equips it for some reason kidsteve923 139 — 3y
0
it changed my health to 110 so it does detect fullguyblox3 69 — 3y
Ad

Answer this question