I want make a script.
When i press 'r' , i want go to mouse's position.
Please help somebody.
First, find the player when they enter, and get their mouse Using a local script in StarterGui
local plr = game.Players.LocalPlayer local mouse = plr:GetMouse()
now set an event for on key down
local plr = game.Players.LocalPlayer local mouse = plr:GetMouse() mouse.KeyDown:connect(function(key) end)
Now set conditions for which key:
local plr = game.Players.LocalPlayer local mouse = plr:GetMouse() mouse.KeyDown:connect(function(key) if key == "r" then end end)
Now Teleport:
local plr = game.Players.LocalPlayer local mouse = plr:GetMouse() mouse.KeyDown:connect(function(key) if key == "r" then if plr.Character then --check if character is there plr.Character:MoveTo(mouse.Hit.p) --move to mouse's position end end end)
Ask me for further help :)