Equipping tool to become giant/big Help

i want to make when you equip a tool you become a giant

this is the script:

 Tool = script.Parent
 function onEquippedLocal()
 	local Character = Tool.Parent
	local Player = game.Players:GetPlayerFromCharacter(Character)
 	local hum = Character.Character.Humanoid
 	script.Parent.Parent.Parent.Parent.Big.Value = true
 	hum.HeadScale.Value = hum.HeadScale.Value + 3
	hum.BodyHeightScale.Value = hum.BodyHeightScale.Value + 3
	hum.BodyWidthScale.Value = hum.BodyWidthScale.Value + 3
	hum.BodyDepthScale.Value = hum.BodyDepthScale.Value + 3
	hum.WalkSpeed = hum.WalkSpeed + 30
	hum.JumpPower = hum.JumpPower +20
 	hum.MaxHealth = hum.MaxHealth + 2000
 end

 function onUnequippedLocal()
 	local Character = Tool.Parent
	local Player = game.Players:GetPlayerFromCharacter(Character)
 	local hum = Character.Character.Humanoid
 	script.Parent.Parent.Parent.Parent.Big.Value = true
 	hum.HeadScale.Value = hum.HeadScale.Value + 1
 	hum.BodyHeightScale.Value = hum.BodyHeightScale.Value + 1
 	hum.BodyWidthScale.Value = hum.BodyWidthScale.Value + 1
 	hum.BodyDepthScale.Value = hum.BodyDepthScale.Value + 1
 	hum.WalkSpeed = hum.WalkSpeed + 25
 	hum.JumpPower = hum.JumpPower +50
 	hum.MaxHealth = hum.MaxHealth + 250
 end

 Tool.Equipped:connect(onEquippedLocal)
 Tool.Unequipped:connect(onUnequippedLocal)

but its not working. how do i make it work pls help

There are a bunch of errors in your code
You can use character:ScaleTo() instead of modifying humanoid properties:

Tool = script.Parent
 function onEquippedLocal()
 	local Character = Tool.Parent
	local Player = game.Players:GetPlayerFromCharacter(Character)
 	local hum = Character.Humanoid — humanoid is child of character
 	Character:ScaleTo(1.5) — makes character grow by 1.5
	hum.WalkSpeed += 30 — makes code more readable
	hum.JumpPower += 20
 	hum.MaxHealth += 200

script.Parent.Parent.Parent.Parent.Big.Value = true

 end

 function onUnequippedLocal()
	local Player = Tool.Parent.Parent — tool in backpack, which is child of player
local Character = Player.Character — get character from player
 	local hum = Character.Humanoid
 	Character:ScaleTo(1) — scales player back to normal
 	hum.WalkSpeed -= 25
 	hum.JumpPower -= 50
 	hum.MaxHealth -= 250

script.Parent.Parent.Parent.Parent.Big.Value = false

 end

 Tool.Equipped:connect(onEquippedLocal)
 Tool.Unequipped:connect(onUnequippedLocal)
2 Likes

I’m not a super programmer but maybe this script could work:



Tool = script.Parent

local PLAYERS_SERVICE = game:GetService("Players")

function onEquippedLocal()
	local Player = PLAYERS_SERVICE:GetPlayerFromCharacter(Tool.Parent.Parent)
	local Character = Player.Character
	local Humanoid = Character:WaitForChild("Humanoid")

	Character:ScaleTo(1.5)
	Humanoid.WalkSpeed = Humanoid.WalkSpeed + 30
	Humanoid.JumpPower = Humanoid.JumpPower + 20
	Humanoid.MaxHealth = Humanoid.MaxHealth + 2000

	script.Parent.Parent.Parent.Parent.Big.Value = true
end

function onUnequippedLocal()
	local Player = PLAYERS_SERVICE:GetPlayerFromCharacter(Tool.Parent)
	local Character = Player.Character
	local Humanoid = Character:WaitForChild("Humanoid")

	Character:ScaleTo(1)
	Humanoid.WalkSpeed = Humanoid.WalkSpeed - 25
	Humanoid.JumpPower = Humanoid.JumpPower - 50
	Humanoid.MaxHealth = Humanoid.MaxHealth - 250

	script.Parent.Parent.Parent.Parent.Big.Value = false
end

Tool.Equipped:connect(onEquippedLocal)
Tool.Unequipped:connect(onUnequippedLocal)

It worked, but there were bugs on it soo i fixed it by removing the ā€˜+’ and ā€˜-’.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.