My script does change the Model's orientation but it seems that once you click the button that activates the event it changes the orientation again, What I actually want it to do is, Set the orientation at a certain amount instead of increasing it by 20 every time I click it. I want it to stay at 20 if you understand what I mean.
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local createPartEvent = ReplicatedStorage.BEDEVENTS2:WaitForChild("BedMovePos2")
local function onCreatePartFired(player)
do
if player:findFirstChild("leaderstats") then
print "hey"
local housetag = game.Workspace.PickSpawn[""..player.Name..""]
local playerhouse = game.Workspace.PickSpawn:FindFirstChild(""..housetag.value.."")
local cframe= CFrame.new(playerhouse.Spawn.Bed.PrimaryPart.Position)
playerhouse.Spawn.Bed.PrimaryPart.Orientation = Vector3.new(0,20,0)
playerhouse.Spawn.Bed:SetPrimaryPartCFrame(cframe * CFrame.new(0, math.rad(0), 0))
end
end
end
createPartEvent.OnServerEvent:Connect(onCreatePartFired)

1 comment
I'm very new so this probably wont work... But maybe you can put end where u want it to stop. I doubt it will work but it wont hurt to try