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

How do i make a player teleport right after an NPC chat is over?

Asked by 4 years ago
Edited 4 years ago

I'm new to scripting and I'm making an adventure game, and i want to know how to have the player chat to the npc, then right after the screen transitions and then teleports the player.

0
you mean you want someone to make an NPC chat script then a camera script for 'transitions' and then make the player change CFrame? (tp) aiming4u 61 — 4y
0
Yes, basically.. AmondaMichel 2 — 4y
0
game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = Vector3.new(CFrame.new(coordinateshere)) should work for TP, as for the rest, you can use the camera position and a gui with a brick touch (which has debounce and values to set the next objective of your game) aiming4u 61 — 4y
0
Thank you!! AmondaMichel 2 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago
  • first
game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = Vector3.new(CFrame.new(coordinateshere))
  • second
  • put this in a no-collide invisible brick
local debounce = false

function TouchEvent(trigger)
       if debounce == false then
        if game.Players:FindFirstChild(trigger.Parent.Name) then
             debounce = true
                  local tag = Instance.new("BoolValue")
                            tag.Parent = game.Players[trigger.Parent.Name]
                                 tag.Value = true
                                   tag.Name = "NPCTALK1"
                   end
          end
  end

script.Parent.Touched:Connect(TouchEvent)

2 scripts you could use for triggering the event and teleportation.

  • bool value name is NPCTALK1 so make a check for that when you need to assure the event has passed in the game (helps vs exploiters)
Ad

Answer this question