I want make a script.
When i press 'r' , i want go to mouse's position.
Please help somebody.
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 :)
Thanks! :D
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
Sir, ScriptingHelpers is not a site to ask for scripts, but is a site for aiding in the debugging or explanation of scripts and functions. We ask that you make a attempt to create your own script prior to and within your questions. Thank you.