Cframe Works In Studio, But frozen in game

It runs on day 1 and day 0 is the starting day. When the code runs it like teleports above were it would have “landed”

So It was more of a Lag Problem. Also had to change it from replicated storage to ServerStorage

Ok so it works now in studio with play and play here. But now does not work in game. It’s still frozen in air. Though it still runs threw it’s script.

You could try printing each time you do something, and see if something isn’t running accordingly.

1 Like

I have and it prints “shooting” though it never moves and yet, it continues to run the script.

1 Like

The only thing I could recommend now is lerping the part.
Link to lerping “tutorial” if you will

1 Like

Wait could it not work because of network ownership? The cylinders is un anchored

You could try moving the script into else where and testing if it works like starter character for instance
That may help you. I found problems like this and its often solved by moving the script places.
Filtering enabled could also be a issue.
Also where in fact is the actual parts?

1 Like

The Parts have been put in serverStorage. Now I have it set up to were like in the book 1 cylinder at midnight. image

It would be better to put them in replicated. And put the script into server storage. But idk if that would break it but its worth a try well like try changing them around abit to see if they work in different area’s.
if you don’t really wanna change the scripts just put them in the different places in studio and see if it works in game!

1 Like

I think this code needs a complete rewrite.

local cylinder = script.Parent
local Lid = script.Parent["Lid"]
local trail = script.Parent["Trail"]
local smoke = script.Parent["Smoke"]
local light = script.Parent["SurfaceLight"]
local screw = Lid.Screw
local heat = script.Parent["Heat"]
local crater = game.ReplicatedStorage.Crater

print("Shooting")
for i=1,75 do
	cylinder.CFrame=cylinder.CFrame+Vector3.new(100,-20,0)
	wait(0)
end

cylinder.Anchored = true
local newCrater = crater:Clone()
newCrater.CFrame = cylinder.CFrame
newCrater.Parent = workspace
cylinder.CanCollide = true
heat.Enabled = true
light.Enabled = false
trail.Enabled = false
smoke.Enabled = false
print("landed")
wait(40)
heat.Enabled = false
local weld = cylinder.WeldConstraint
screw.Enabled = true
Lid.Anchored = true
Lid.CanCollide = false
wait(2)
screw.Enabled = false
local rs: (RunService) = game:GetService("RunService")
local i = 0
while rs.Heartbeat:Wait() and i <= 500 do --100 is the amount of times you want the code below to run
	i += 1
	Lid.CFrame = Lid.CFrame * CFrame.Angles( 0, math.rad(1), 0 ) * CFrame.new(0,0.03,0) 
end
weld:Destroy()
Lid.Anchored = false
Lid.CanCollide = true
print("openLid")
1 Like

The problem is it could be non server sided also. So I would copy that code and put it away for later then edit that to work for a normal script or even use remote events for certain things or just completely rewrite the code in its own write without making it a normal script.
I hope you make the script work in game properly!
I will try to help you out as much as I can for this topic if its really a problem.

1 Like

The print shooting part doesn’t actually tell you if the script is running properly. Try placing print shooting in all of the script executions and out and count how many you put and how many are being activated before you start changing the code.
Test it in game where it doesn’t work and some how use the developer console or something like that to see how many are actually being set off.
So it tells you how much of the script is actually running properly!

The Scripts works, Well it Spawns in workspace but it stuck in the air. Though it will run though its code still as it prints the rest of the code and the lid falls off.

1 Like

If the lid falls off it might have something to do with anchored part of the script.
Try rewritting that!

oops, I meant that is suposed to happen. image I think it is filter enabled as when I do test it works as should and when I do current client it works. Wait So It did work in client when I had it ServerStorage. But in replicated storage it doesn’t work.

Oh sorry, Well I hope you find a answer to your problem but I think you should test two players on the game in game and see how it works.

1 Like

This should prove useful for the problem read up on it:

I hope this was useful (Skip to the solution) after reading the problem.

1 Like

Wait Filter Enabled, Would I need to use a Remote Event for that?

local Lid = cylinder.Lid;
local trail = cylinder.Trail;
local smoke = cylinder.Smoke;
local light = cylinder.SurfaceLight; 
local heat = cylinder.Heat;

local crater = game:GetService("ReplicatedStorage").Crater;
local runService = game:GetService("RunService");


local shooting = function()
	for i=1,75 do
		cylinder.CFrame = cylinder.CFrame + Vector3.new(100,-20,0)
	end
	
	
	cylinder.Anchored = true;
	local newCrater = crater:Clone();
	newCrater.Parent = game.Workspace;
	newCrater.CFrame = cylinder.CFrame;
	cylinder.CanCollide = true;
	
	heat.Enabled = true;
	light.Enabled, trail.Enabled, smoke.Enabled = false, false, false;
end

local landed = function()
	heat.Enabled = false;
	Lid.CanCollide = false;
	Lid.Anchored = true;
end

local unscrew = function()
	local weldConstraint = cylinder.WeldConstraint;

	local i = 0;
	while runService.Heartbeat:Wait() and i <= 500 do
		i += 1
		Lid.CFrame = Lid.CFrame * CFrame.Angles( 0, math.rad(1), 0 ) * CFrame.new(0,0.03,0) 
	end

	weldConstraint:Destroy()
	Lid.Anchored = false
	Lid.CanCollide = true
end

shooting()();
wait(40)

landed()();
wait(2)

unscrew()();

I fixed the script to be formatted easyer

You might need to but It can be done without it.