Its not working in server-sided script:
local wire = game.ReplicatedStorage:WaitForChild("Wire")
game.ReplicatedStorage.PlaceWireEvent.OnServerEvent:Connect(function(plr,tablereceieved)
print("lol")
local clone = game.ReplicatedStorage.Wire:Clone()
clone.Parent = workspace
clone.Size = clone.CFrame.LookVector*(tablereceieved["StartingPosition"] - tablereceieved["EndingPosition"]).magnitude + clone.CFrame.RightVector*0.5 + clone.CFrame.UpVector*0.5
clone.CFrame = CFrame.lookAt(tablereceieved["StartingPosition"],tablereceieved["EndingPosition"])
end)
Local script:
mouse.Button1Down:Connect(function()
if currentpos == Vector3.new(0,0,0) then
currentpos = selection.Position
local part = Instance.new("Part",workspace)
part.Shape = selection.Shape
part.Position = selection.Position
part.Size = selection.Size
part.BrickColor = selection.BrickColor
part.CanCollide = false
part.Anchored = true
elseif currentpos ~= Vector3.new(0,0,0) then
local tabletosend = {
["StartingPosition"] = currentpos,
["EndingPosition"] = selection.Position
}
game.ReplicatedStorage.PlaceWireEvent:FireServer(tabletosend)
wait(0.25)
currentpos = Vector3.new(0,0,0)
end
end)
What it does is, get two points, make a wire between them