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

LocalScripts and Script, help?

I'm trying to make something where when you touch a brick, you're character is supposed to go to a different place and anchor your torso so you can move, but it isn't working.

Real Script

hello = script.Parent.Hello
ls = script.LocalScript.Parent:Clone()
script.Parent.Touched:connect(function()
	ls.Parent = Backpack
	ls.Disabled = false
end)

LocalScript

while wait(0) do
game.Players.LocalPlayer.Character.Torso.CFrame = CFrame.new(48.885, 1.95, -31.966)
game.Players.LocalPlayer.Character.Torso.Anchored = true
end

Thank you for your help.

1 answer

I don't know if this was the wrong part i think you needed an onTouch function and also the cframe wasn't a real position. Here try this

while wait(0) do
function onTouch
game.Player.LocalPlayer.Player.Torso.CFrame = CFrame.new()--the position you want the player to go to FIRST check if it's a real position
game.Player.LocalPlayer.Player.Torse.Anchored = true
--im gonna make it move pack to the brick and make the player not teleport again
game.Player.LocalPlayer.Player.Torso.CFrame = CFrame.new()-- the brackets are the position of where the brick is
end

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