Hello scripters, I have recently tried to make a script that makes you taller each time you collide with it. I'd like to make it so once you touch it, it disappears so you can't do it again. How do I make this? (Please explain your steps very carefully, I'm not that good at scripting!)
Here you go, hope this helps. Ask me questions if you have any! :)
local growPart = script.Parent --Make sure to have this script inside the part and name that part GrowPart
game.Workspace.GrowPart.Touched:Connect(function(hit) --When the part is touched if game.Players:GetPlayerFromCharacter(hit.Parent) then --Checks if the part is being touched by a player and not another part/baseplate etc hit.Parent.Humanoid:WaitForChild("BodyHeightScale").Value = 2 --Changes the height of the player (you can change this to widthscale etc) growPart:Destroy() --Deletes the part once you have stepped on it end end)
// // //
Raw Code:
local growPart = script.Parent game.Workspace.GrowPart.Touched:Connect(function(hit) if game.Players:GetPlayerFromCharacter(hit.Parent) then hit.Parent.Humanoid:WaitForChild("BodyHeightScale").Value = 2 growPart:Destroy() end end)