game:GetService('ReplicatedStorage').ChestEvents.ReleaseOrbs.OnClientEvent:Connect(function(pos)
local TS = game:GetService('TweenService')
local player = game.Players.LocalPlayer
local Orb2 = script.CoinOrb
local Orb = Orb2:Clone()
game:GetService('ReplicatedStorage').ChestEvents.ReleaseOrbs.OnClientEvent:Connect(function(pos)
local TS = game:GetService('TweenService')
local player = game.Players.LocalPlayer
local Orb2 = script:WaitForChild("CoinOrb")
local Orb = Orb2:Clone()
end)
Sometimes objects don’t load into the game right away. You could use WaitForChild to wait until the game detects that the object has loaded.It will yield (pause) the script until it detects that the part is there, or if it doesn’t exist, you will get a warning message in the output.
It isn’t when I play it. But if I test in a base plate, the coin orb is in the script. If I test it in another game, the coin orb is not in the script when I play it. It it because of the code written in the new game?
You have to put the part inside of the script in order for it to work.
Also, you could have easily made a mistake in your code. For example, destroying the object or setting the part to another value… script.CoinOrb = game.Workspace trying to set the part itself instead of it’s parent would destroy the object.