Am trying to make a bow. And I’m using a server event to get the player mouse, and send it to the server. Then I have a attachment that the mouse position is sent to the world position. but the position is wrong. If I point at anywhere, the position is just the world center(0,0,0) with small differences. like 0.12 or 0.45. I’m getting the right position, but when I try to put it to the attachment, it breaks.
Here is the localscript:
local plr = game.Players.LocalPlayer
local mouse = plr:GetMouse()
mouse.Move:Connect(function()
if script.Parent.Parent.Active.Value == true then
script.Parent.RemoteEvent:FireServer(mouse.Hit.Position)
--print(mouse.Hit.Position)
end
end)
and here is the script:
script.Parent.RemoteEvent.OnServerEvent:Connect(function(plr, pos)
if script.Parent.Parent.Active.Value == true then
script.Parent.WorldPosition = Vector3.new(pos)
end
end)
script.Parent.Parent.Parent.Activated:Connect(function()
script.Parent.Parent.Active.Value = true
end)
script.Parent.Parent.Parent.Deactivated:Connect(function()
script.Parent.Parent.Active.Value = false
end)
script.Parent.Parent.Active.Changed:Connect(function()
if script.Parent.Parent.Active.Value == false then
script.Parent.Position = Vector3.new(30, 0, 0)
end
end)