i am making a script for buildgn stuffs but the mauses targert is always the player? I dont know why its like that but help would be helpful!
Scripts:
-- this is the local script
script.Parent.Activated:Connect(function(d)
local Plr = game.Players.LocalPlayer
local Mouse = Plr:GetMouse()
script.Parent.Event:FireServer(Plr,Mouse.Target)
end)
-- this is the serverside scirpt
script.Parent.Event.OnServerEvent:Connect(function(plr, Target)
if Target == nil then print("no mouse") return end
if Target:HasTag("Defence") then
local New = Target:Clone()
New.Parent = workspace
New.Position += Vector3.new(0,New.Size.Y,0)
print("Cloned part!")
else
print("Part ("..tostring(Target)..") not usable.")
end
end)