this is not working
local Player = game.Players.LocalPlayler local mouse = Player:GetMouse() local tool = game.workspace.Tool
mouse.KeyDown:connect(function(Key) tool:Clone().Parent = player.Backpack end
this is not working
local Player = game.Players.LocalPlayler local mouse = Player:GetMouse() local tool = game.workspace.Tool
mouse.KeyDown:connect(function(Key) tool:Clone().Parent = player.Backpack end
When using the keybind, make sure to use mouse.target and check if your (torso.Position-object.Position).magnitude is greater than or equal to any number.
Something like this (I am at school right now, so i cant really check if i wrote this right lol): local m = player:GetMouse() local mt = m.Target
if (m.Hit.p - player.Character.Torso.Position) <= 10 then local item = mt --etc, etc...
If this didnt help then please say so.
umm id realy get it i dont want to teleport or something i want like when a player gets close to an item and he presses lets say h he would get an item n his backpack
none of that teleports anything. just add the if (m.Hit.p - player.Character.Torso.Position) <= 10 then local- bla bla bla in the keydown function. also actually dont use mouse.keydown, use userinputservice
^ Lol yes, thank you
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
Use magnitude and mouse.target.