Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

The same thing everytime I try to make a game, every. single. time. Any fixes?

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)

4 comments

0

Is that in a ServerScript or LocalScript?

0

@herrtt serverscript.

0

are you using filtering enabled?

0

Nope, It's off.

1 answer

✓ Accepted answer

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!

5 comments

0

Nope, stii doesnt work.. however it works on studio

0

Alright

0

Put the opened chest somewhere in the workspace

0

And I'll edit the script

0

Edited it just make sure to put the opened chest somewhere in the workspace! (Hide it)

This discussion is preserved as it was. New answers, comments, and votes are closed.