I wanted to make a script where you can pull something your way with the force ( Star wars) So what I want to happen is the item you click (If its unanchored) needs to have a force towards your right hand. I tried it but the mouse.Target shoots towards a way different direction. I've tried messing with the maxforce and such but It never went near the arm. Please help out! How do I do this?
This is the script
-- Configurable variables
PushPull = true -- Push is True, Pull is False
JediLevel = 10
-- Non-Configurable variables
CooldownPush = 0
CooldownPull = 0
Stamina = 100
mouse = nil
Hit = nil
Target = nil
Tool = script.Parent
oldC0 = nil
nweld = nil
v = nil
script.Parent.Activated:connect(function()
mouse = game.Players.LocalPlayer:GetMouse()
Hit = mouse.hit
Target = mouse.Target
if mouse.Target ~= nil then
if mouse.Target.Parent ~= nil then
if PushPull == true then
if CooldownPush == 0 then
if Stamina >= 59 then
if Target.Anchored == false then
v = Instance.new("BodyVelocity", Target)
v.Velocity = game.Players.LocalPlayer.Character["Right Arm"].Position * 180
v.MaxForce = Vector3.new(100,100,100)
end
end
end
end
end
end
end)

1 comment
Thanks for replying but I have no clue what you're trying to say. It's probably me being from Europe but could you give a script example or tell me in noobglish?