but are they not the children of the tool
Do you get any output errors?
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!
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?
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
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?
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
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
The script is not the child named “contents”.
Hey @PixelDominoes change the last line
potion.Contents:Destroy()
humanoid.Health = 100
to this
humanoid.Health = 100
potion.Contents:Destroy()
the reason why is because you are destroying the item before you get the 100 heath
I’m pretty sure this has been resolved by now, try not to bump any other posts please