So i have a cutscene in my game triggered by a part touch. in order for the cutscene to work the player needs to be teleported to one block where he/she is seated then in 10 seconds teleported to block 3. As well as having the player anchored during the cutscene so he/she cant jump around which is very hard given the seat and teleport pads.
function onTouch(part) if part.Parent.Humanoid ~=nil then part.Parent:MoveTo(script.Parent.Parent.Tele2.Position) end end script.Parent.Touched:connect(onTouch)``````
function onTouch(part) if part.Parent.Humanoid ~=nil then wait(10) part.Parent:MoveTo(script.Parent.Parent.Tele3.Position) script.Parent.Parent.Tele3.Script.Disabled = false wait(0) script.Parent.Parent.Tele3.Script.Disabled = false end end script.Parent.Touched:connect(onTouch)
is what i have on teleport pad 2
function onTouch(hit) local player = hit.Parent:WaitForChild("HumanoidRootPart") if player then wait(.1) player.Anchored = true wait(10) player.Anchored = false end end script.Parent.Touched:Connect(onTouch)
is what i also have on teleport pad 1 to anchor the player and then un-anchor. I think it would be easier if teleport pad 2 didnt have a script and instead teleport pad just had a wait(!0) after the first teleport to the second but i cant figure it out. Any help or solutions would be greatly appreciated!
Instead of having the Player Anchored, I recommend disabling the player's Controls, like this:
local PlayerModule = require(plr.PlayerScripts.PlayerModule) local Controls = PlayerModule:GetControls() Controls:Disable()
And in case you want to Enable these Controls, just write this:
Controls:Enable()
I should mention that plr is the player that you want to have their Controls disabled, so change that to however you are defining the player. Also, this doesn't anchor your player or anything, just simply makes them unable to Control it, which allows you to move the character freely.