Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

When i go on my morph pad I don't move?

Asked by 2 years ago

i dont move when i touch the pad i got the scripit of youtube so idk if it good or bad

1 answer

Log in to vote
0
Answered by 2 years ago

You... didn't provide a script.

I'm sure it's fine, I'll add code for you.

Make sure you put a script in the part and remove your previous morph pad.

Get the character you want to morph and put it inside ServerStorage. Make sure the model is unanchored!

local part = script.Parent
local debounce = false
local CharacterToMorph = game.ServerStorage.NameHere -- Replace NameHere with the name of your character in serverstorage.

script.Parent.Touched:Connect(function(hit) -- Fires a .Touched function
    if hit.Parent then -- Checks if the hit argument we have has a parent
        if hit.Parent:FindFirstChild("Humanoid") then -- Checks if the hit argument's parent has a Humanoid
            local plr = game.Players:FindFirstChild(hit.Parent.Name) -- Searches for a player in the Players service with a matching name to the hit argument's parent

            if plr and debounce == false then -- Checks if the player exists and also checks if debounce is false
                debounce = true
                 local c = CharacterToMorph:Clone() -- Clones the character we need to morph
                    c.Name = plr.Name -- Names the clone the same as the player's name
                    plr.Character = c -- Sets the player's character as the clone

                wait(5) -- Change 5 to how long you want the wait to be when it's interactable again

                debounce = false -- Sets debounce to false so it is usable again

            end
        end
    end
end)
Ad

Answer this question