ive never Done anything with Mouse, So Plz Have mercy on me Most of it is probably wrong im realy new to scripting so plz help me out
player = game.Players.LocalPlayer mouse = player:GetMouse() char = player.Character tor = char.LowerTorso function onKeyPress(inputObject, gameProcessedEvent) if inputObject.KeyCode == Enum.KeyCode.F then local tp = mouse:Move() tor.Postion = tp.CFrame end game:GetService("UserInputService").InputBegan:connect(onKeyPress)
I want to make to make something Like the flash Step On bleach But it Wont Work At all, I just Want to be able to TP where the Mouse is
-- Make your variables local, unless they have to be global. local inputservice = game:GetService("UserInputService") local player = game.Players.LocalPlayer local mouse = player:GetMouse() -- Wait for character if not available local char = player.Character or player.CharacterAdded:wait() local activated = false inputservice.InputBegan:connect(function(input) if input.KeyCode == Enum.KeyCode.F then activated = not activated end end) -- Anonymous function mouse.Move:connect(function() -- mouse.Hit = CFrame -- mouse.Hit.p = Vector -- mouse.Hit.x = x-location -- Make it's activated -- Make sure you're actually hovering over something and not the skybox if activated and mouse.Target then char:MoveTo(mouse.Hit.p) end end)