Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

I need help with my transformation local script?

When i tried to add health, maxhealth, walkspeed and jumppower, it wont work how do i fix this or is there any way for me to change the players health, max health jumppower and walkspeed then revert it back to before it was changed?

Tool = script.Parent
player = script.Parent.Parent.Parent
local mouse = player:GetMouse()

Tool.Equipped:Connect(function(mouse)
print("it works")
wait()
 mouse.Button1Down:Connect(function()
		game.Lighting["UpperTorsoParticle1"]:clone().Parent = Tool.Parent.UpperTorso
		
		game.Lighting ["UpperTorsoParticle2"]:clone().Parent = Tool.Parent.UpperTorso

		game.Lighting ["LowerTorsoParticle1"]:clone().Parent = Tool.Parent.LowerTorso
		
	
			Tool.Parent.Humanoid.Health + 150
			Tool.Parent.Humanoid.MaxHealth + 150
			Tool.Parent.Humanoid.JumpPower + 90
			Tool.Parent.Humanoid.WalkSpeed + 50
		print('on')
	end)
end)




1 answer

✓ Accepted answer

You need to do:

Tool.Parent.Humanoid.Health = Tool.Parent.Humanoid.MaxHealth + 150
Tool.Parent.Humanoid.MaxHealth = Tool.Parent.Humanoid.MaxHealth + 150
Tool.Parent.Humanoid.JumpPower = Tool.Parent.Humanoid.MaxHealth + 90
Tool.Parent.Humanoid.WalkSpeed =Tool.Parent.Humanoid.MaxHealth + 50

This gives ROBLOX a value to perform arithmetics on and equal signs are also needed.

1 comment

0

Wow thanks i cant believe i didnt remember that

This discussion is preserved as it was. New answers, comments, and votes are closed.