Health Potion not working

That wouldn’t make a difference because that’s just the contents and not the whole tool itself.

I tried your script, but now the animation doesn’t play, like nothing works for some reason.

but are they not the children of the tool

Do you get any output errors? :thinking: :sweat_smile:

1 Like

They are the children, but the tool is still there, therefore the script shouldn’t break.

Okay well, everything is working. Do you guys know how to make the tool get out of my inventory when my health goes to 100?

script.Parent:Destroy()

this should help!

1 Like

Thank you guys, do you also know how to make the fov change by script? Like, when i click with the tool, the fov changes locally?

1 Like

but isnt the script one of the children of the tool and since it will get destroyed it will not be able to finish the code

i think its a property of the current camera

1 Like

You can use RemoteEvents to change the Field Of View for the Player locally by using FireClient() & OnClientEvent(), keep in mind that FireClient() requires a Player Object for it to work

Oh okay, but adding on to that. If I’d add onto my script and make the fov change smoothly when I click, how’d I do that?

i think this will help

use tween service!!!

I’m just really confused rn, I don’t know how to script at all that’s why I’m asking for help

1 Like

All I want to accomplish is that, when you equip the tool, you click, the fov changes smoothly to some number

I believe you could use TweenService’s Create() function to smoothly tween the Camera’s FOV, but I’m not entirely sure

You learn a lot of new things when scripting lol

local cam = game.workspace.CurrentCamera


 while wait() do 
      cam.FieldOfView = cam.FieldOfView + 0.5
 end
1 Like

The script is not the child named “contents”.

okay

2 Likes

Hey @PixelDominoes change the last line
potion.Contents:Destroy()
humanoid.Health = 100
to this
humanoid.Health = 100
potion.Contents:Destroy()

1 Like