So, everytime I make a game, it works on studio and NOT in the servers, is there a fix for this? In this one when I clicked the clickdetector, it didn't do anything nor gave me an error.
script.Parent.MouseClick:Connect(function() script.Parent.Parent.Parent.ClosedChest.Parent = game.ReplicatedStorage -- Hiding the closed chest local chest = game.ReplicatedStorage.Chest:Clone() -- Cloning the opened chest chest.Parent = workspace chest:SetPrimaryPartCFrame(CFrame.new(script.Parent.Parent.Parent.chestloc.Position)) --Teleporting the open chest to the location of a brick called "chest location" to make it look like it opened up script.Parent:Destroy() -- Deleting the clickdetector end)
I would teleport the Closed chest to a random location instead of putting it to a ReplicatedStorage so your code would look like this in my case:
(Make sure to turn on Filtering Enabled)
local ReplicatedStorage = game:GetService("ReplicatedStorage") script.Parent.MouseClick:Connect(function() script.Parent.Parent.Parent.ClosedChest:MoveTo(CFrame.new(99999, 99999, 99999)) local chest = game:GetService("Workspace"):WaitForChild("Chest") chest:SetPrimaryPartCFrame(CFrame.new(script.Parent.Parent.Parent.chestloc.Position)) wait(.05) script.Parent:Destroy() -- Deleting the clickdetector end)
I think that this would not work but it's worth a try! EDIT: Configured it for the opened chest somewhere in the Workspace!