I’ve been working on a script that makes a player larger. When it’s ran, the player instead turns invisible. When they move, they get flung. How do I fix this?
Code:
if plr.Character:FindFirstChild('HumanoidRootPart') then
plr.Character:FindFirstChild('HumanoidRootPart').Position += Vector3.new(0,4,0)
end
plr.Character:ScaleTo(1.5)
local hum = plr.Character:FindFirstChild('Humanoid')
if hum and hum:IsA('Humanoid') then
hum.MaxHealth += 50
hum.Health += 50
hum.JumpHeight *= 1.5
hum.WalkSpeed *= 1.5
end
1 Like
I’ve tested your code and it seems like this is happening because of you moving the players HumanoidRootPart up for seemingly no reason?
My code:
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(character)
character:ScaleTo(1.5)
character:WaitForChild("Humanoid")
character.Humanoid.MaxHealth += 50
character.Humanoid.Health = character.Humanoid.MaxHealth
character.Humanoid.JumpHeight *= 1.5
character.Humanoid.WalkSpeed *= 1.5
end)
end)
I removed that code but nothing changed.
To figure out what the cause of the issue is we would need to know what your game is, how it works and of anything that might cause this issue in the first place. My code above worked in a baseplate in a Script in ServerScriptService with no issues.
It’s sort of a last to leave the circle game. I don’t think I modify the character other than that piece of code, since I set that as the first event. I’ll see if I find any changes to the character before that.
I noticed that the character reappears when you die.