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

Teleporting parts to the character wont work?

I'm trying to make a script that makes a model from lighting (Board) be cloned into the character and move to the characters position. Right now it spawns the board moves it o the character directory but dosen't move to the character. so far i've got this.


game.Players.PlayerAdded:connect(function(player)
    player.Chatted:connect(function(message)
        processCommand(player, message)
    end)
end)




function processCommand(speaker, message)
    if message == "spawn board" or message == "spawn Board" or message == "Spawn Board" or message == "Spawn board" then
        print(speaker.Name)
		board = game.Lighting.Hoverboard:Clone()
		board.Parent = speaker.Character
		local pos = speaker.Character:GetModelCFrame()
		wait()
		board.SkateboardPlatform.Position = Vector3.new(pos)
    end
end

1 answer

✓ Accepted answer

Nevermind, this should do.

game.Players.PlayerAdded:connect(function(player)
    player.Chatted:connect(function(message)
        processCommand(player, message)
    end)
end)




function processCommand(speaker, message)
    if message == "spawn board" or message == "spawn Board" or message == "Spawn Board" or message == "Spawn board" then
        print(speaker.Name)
        board = game.Lighting.Hoverboard:Clone()
        board.Parent = speaker.Character
        local pos = speaker.Character.Torso.Position
        wait()
        board.SkateboardPlatform:MoveTo(pos)
    end
end

1 comment

0

(message == "spawn board" or message == "spawn Board" or message == "Spawn Board" or message == "Spawn board") can be shortened to (message:lower() == "spawn board")

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