I made a placement script but when I rotate it, then place it, it doesn't rotate the placed item. The client that is under this works fine but the Handler is the problem.
Client (under StarterGui):
local runService = game:GetService("RunService")
local plr = game.Players.LocalPlayer
local mouse = plr:GetMouse()
local UserInputService = game:GetService("UserInputService")
local Table = game.ReplicatedStorage:WaitForChild("Table"):Clone()
Table.Parent = workspace
local placed = false
mouse.Button1Up:Connect(function()
game.ReplicatedStorage.PlaceTable:FireServer(placed,mouse.Hit)
placed = not placed
end)
UserInputService.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.R then
print("Works")
if placed then
else
Table.TableBase.Orientation += Vector3.new(0, 90, 0)
game.ReplicatedStorage.Table.TableBase.Orientation += Vector3.new(0, 90, 0)
end
end
end)
runService.RenderStepped:Connect(function()
if placed then
Table.Parent = nil
else
if Table then
Table:SetPrimaryPartCFrame(CFrame.new(mouse.Hit.Position))
Table.Parent = workspace
else
Table = game.ReplicatedStorage:WaitForChild("Table"):Clone()
end
end
end)
Handler (under ServerScriptService):
game.ReplicatedStorage.PlaceTable.OnServerEvent:Connect(function(player,placed,baseCFrame)
if placed == true then
if workspace:FindFirstChild(player.Name.."Table") then
workspace:FindFirstChild(player.Name.."Table"):Destroy()
end
else
local Table = game.ReplicatedStorage.Table:Clone()
Table.Name = player.Name.."Table"
Table:SetPrimaryPartCFrame(CFrame.new(baseCFrame.Position))
--rotating script (I dont know what to do)
Table.Table.Transparency = 0
Table.Table.Anchored = false
Table.TableBase.Anchored = false
Table:FindFirstChild("Table").CanCollide = true
Table.Parent = workspace
end
end)
Thanks to anyone who can help.

2 comments
I'm trying to get the Orientation of the Table that is in Replicated storage and put that orientation into the TableBase that's now in the Workspace
place line 11 after line 16