So, I want a tool that heals you by ten health, it works but after 1 second or so it will go back to the original health value. The script is super short so that must be something that I’m missing. Here’s tthe script.
local AppleTool = script.Parent
local player = game:GetService("Players").LocalPlayer
local HealingAmount = 10
AppleTool.Activated:Connect(function()
player.Character.Humanoid.Health = player.Character.Humanoid.Health + HealingAmount
AppleTool:Destroy()
end)
Through this, I infer you are using a local script . Modifying health through the local script will not replicate to the server .
Put this in a script inside your tool.
script.Parent.Activated:Connect(function()
script:FindFirstAncestorWhichIsA("Model"):FindFirstChildWhichIsA("Humanoid").Health += 10
script.Parent:Destroy()
end)
1 Like
Instead of doing this you can also do this:
player.Character.Humanoid.Health += HealingAmount
1 Like
FurukanDev
(TheFurukanDev)
August 24, 2022, 10:08am
#4
you use a local script, so it will work only in local, other players cant see it.
use a server script.
It didn’t work at all, nothing happened.
FurukanDev
(TheFurukanDev)
August 24, 2022, 10:14am
#6
is there any error in the output ?
No, just nothing at all. 30 limit
FurukanDev
(TheFurukanDev)
August 24, 2022, 10:17am
#8
print("Script Running")
script.Parent.Activated:Connect(function()
print("Activated")
script:FindFirstAncestorWhichIsA("Model"):FindFirstChildWhichIsA("Humanoid").Health += 10
script.Parent:Destroy()
end)
can you add this code then send me the output.
Nothing at all, which means that the script isn’t working or running.
FurukanDev
(TheFurukanDev)
August 24, 2022, 10:23am
#10
can you send me the explorer. where is the script
The Parent of the script is the tool.
FurukanDev
(TheFurukanDev)
August 24, 2022, 10:25am
#12
can you send an image
char limit char limit
FurukanDev
(TheFurukanDev)
August 24, 2022, 10:28am
#14
why it is in replicated storage ?
FurukanDev
(TheFurukanDev)
August 24, 2022, 10:28am
#15
try putting it in starter pack
Because you need to buy it first (Shop system thingy)
FurukanDev
(TheFurukanDev)
August 24, 2022, 10:31am
#17
no add it just to try
char limit
It worked some how char limit char limit
FurukanDev
(TheFurukanDev)
August 24, 2022, 10:38am
#19
try putting it inside server storage and clone it to players backpack from the serverstorage, mark me as solution if it worked
Did you disable
the Tool.RequiresHandle property?
If not, try that and inform us as scripts don’t usually run when you have no part named “Handle” in your tool and have this property enabled
.