Door opening Tween not working on server-side?

Hey! So I made a Door Tween and it’s working fine but for some reason when I switch to “Current: Server” in the Studio the door is still closed even tho i literally opened it 2 seconds ago? When I tried it ingame with a friend the door opened for both of us synced but in Studio its scuffed…

I need it to work on the server-side because i got an NPC who is hunting the players but it can’t walk inside the room as it sees the door as closed all the time.

robloxapp-20230131-1747008.wmv (606.9 KB)

Is the tween running on the server or the client? Any changes made on your client will not take effect on the server.

It is a script inside of the door which gets triggered by a proximityPrompt so its on the server side

Can I see your script? I can’t help until I know what your code looks like…

`local tweenService = game:GetService(“TweenService”)

local Moving = false

script.Parent.Door.DoorHandle.ProximityPrompt.Triggered:Connect(function()

if not Moving then

	local Primary = script.Parent.Door.Primary

	if Primary.Rotation.Y == 90 then
		
		Moving = true
		
		local tweenInfo = TweenInfo.new(0.75,Enum.EasingStyle.Quad,Enum.EasingDirection.In,0,false,0)

		local tween = tweenService:Create(Primary, tweenInfo, {Rotation = Vector3.new(0,0,0)})

		tween:Play()

		tween.Completed:Wait()

		Moving = false
		
		script.Parent.Open.Value = false
	
	elseif Primary.Rotation.Y == 0 then
		
		Moving = true
	
		local tweenInfo = TweenInfo.new(0.75,Enum.EasingStyle.Quad,Enum.EasingDirection.Out,0,false,0)
	
		local tween = tweenService:Create(Primary, tweenInfo, {Rotation = Vector3.new(0,90,0)})
	
		tween:Play()
		
		tween.Completed:Wait()
		
		Moving = false
		
		script.Parent.Open.Value = true
	
	end
	
end	

end)`

Hmm…
Testing your code on my own part, everything seems fine. Did you make sure everything is properly welded on the server, and that you’re not receiving any errors in the output?

Here’s a video of the script functioning properly:

Hmm… yeah I guess there is some sort of an Weld problem, i’ll try to look at that

1 Like

Well I manged to fix it by changing it to CFrame instead of the PrimaryPart orienation, no clue why that worked but it fixed it!

3 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.