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

possible to make a health script potion ?

Asked by 4 years ago
Edited 4 years ago

I made a health potion script but it won't work the title is weird cuz bot is calling my title spam

script:

local heal = game.ReplicatedStorage.ShootingStuff.HealPotion
local tool = script.Parent.Handle
local cap = script.Parent.Cap

script.Parent.Equipped:Connect(function(mouse)
    mouse.Button1Down:Connect(function()
    local throw = heal:Clone()
    throw.Parent = workspace
    throw.PrimaryPart.Position = tool.Position
    throw.Juice.Position = tool.Position
    throw.Cap.Position = cap.Position
    script.Parent.Handle:Destroy()
    script.Parent.Cap:Destroy()
    script.Parent.Juice:Destroy()
    wait(0.25)

    local h = script.Parent.Parent:FindFirstChild("Humanoid")
    if h then
        if h.Health > 0 then


        h.Health = h.Health + 50
        end
    end

    local particles = game.ReplicatedStorage.Particles["Heal Effect"]
    particles.Parent = workspace.HealPotion.Juice
    wait(3.5)
    throw:Destroy()
    script.Parent:Destroy()
    end)
end)

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

the problem is in tools the script doesn't work if cloned (its a glitch in rob lox they should fix in the future,as far as i know of)

so you could make a health potion gui?

heal button:

script.Parent.MouseButton1Click:Connect(function()
if game.Players.LocalPlayers.Health >== 50 then
game.Players.LocalPlayers.Character.Humanoid.Health = game.Players.LocalPlayers.Character.Humanoid.Health + 50
script.Disabled = true
end
end)
0
there's no ui Eric_pokemon 133 — 4y
0
I'm saying make one Cats767_99 -68 — 4y
0
I'm not cloning the tool I'm cloning a model Eric_pokemon 133 — 4y
0
same thing did it work? Cats767_99 -68 — 4y
View all comments (3 more)
0
oh I get it I'll make a other script Eric_pokemon 133 — 4y
0
ya but a local script in a text button Cats767_99 -68 — 4y
0
please help its me Cats767_99 and I'm suspended :( catsalt29 57 — 4y
Ad

Answer this question