So In my Game there are cylinders that crash into England.
I got the script to work in the test , but not when I load it in game or Play Here or Play. it will work but when falling it will just stay stuck above in the air. Now the script Dose continue to run, as the lid of the cylinder falls off onto the map. I check the Output and Dev Console and nothing is showing errors. My game I am Making is based off the H.G Wells The War Of The Worlds.
Cylinder Code In replicated Storage:
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(20)
heat.Enabled = false
local weld = cylinder.WeldConstraint
weld:Destroy()
screw.Enabled = true
Lid.Anchored = true
Lid.CanCollide = false
wait(2)
screw.Enabled = false
local rs: (RunService) = game:GetService("RunService")
local i = 0
local rs: (RunService) = game:GetService("RunService")
local i = 0
while rs.Heartbeat:Wait() and i <= 600 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
Lid.Anchored = false
Lid.CanCollide = true
print("openLid")
Here is what It looks like in the studio and when it dose work.
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 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?
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!
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")
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.
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.
oops, I meant that is suposed to happen. 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.