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

local player = game.Players.LocalPlayer or game.Players.PlayerAdded:Wait()
local character = player.Character or player.CharacterAdded:Wait()
local part = script.Parent["Left Hand Glove"]
local weld = Instance.new("Weld",part)
local debounce = false
weld.Part0 = part
weld.Part1 = character["Left Arm"]

local tool = script.Parent

tool.Equipped:Connect(function() -- it just dosent give a signal like what
    if not debounce then
        character.Humanoid.MaxHealth = character.Humanoid.MaxHealth + 10
        character.Humanoid.Health = character.Humanoid.Health + 10
        debounce = true
    end
end)

the script that works

local player = game.Players.LocalPlayer or game.Players.PlayerAdded:Wait()
local character = player.Character or player.CharacterAdded:Wait()
local part = script.Parent["Blocky Hat"]
local weld = Instance.new("Weld",part)
local debounce = false
weld.Part0 = part
weld.Part1 = character.Head

local tool = script.Parent

tool.Equipped:Connect(function()
    if not debounce then
        character.Humanoid.MaxHealth = character.Humanoid.MaxHealth + 50
        character.Humanoid.Health = character.Humanoid.Health + 50
        local hatclone = script.Parent["Blocky Hat"]:Clone()
        hatclone.Parent = character.Head        
        debounce = true
    end
end)

both scripts go in tools

1 answer

Log in to vote
1
Answered by 3 years ago
Edited 3 years ago
local player = game.Players.LocalPlayer or game.Players.PlayerAdded:Wait()
local character = player.Character or player.CharacterAdded:Wait()
part = script.Parent["Left Hand Glove"]
local debounce = false

local tool = script.Parent

tool.Equipped:Connect(function() 
    if character.Humanoid.RigType == Enum.HumanoidRigType.R15 then
        local weld = Instance.new("Weld",part)
        weld.Part0 = part
        weld.Part1 = character["LeftHand"]
    else
        local weld = Instance.new("Weld",part)
        weld.Part0 = part
        weld.Part1 = character["Left Arm"]
    end
    if not debounce then
        character.Humanoid.MaxHealth = character.Humanoid.MaxHealth + 10
        character.Humanoid.Health = character.Humanoid.Health + 10
        debounce = true
    end
end)

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 — 2y
0
it changed my health to 110 so it does detect fullguyblox3 69 — 2y
Ad

Answer this question