So there is a part required for the game to work IN REPLICATED STORAGE. when i run the game nothing happens, but when i click a specific button in game that starts the gameplay, the part gets destroyed. I checked for a long time what script was deleting it, but could not find anything. There was a script in the part, and when i disabled it, the part stopped disappearing. I do not see any relation between the rep storage version and the script, because it adresses only the cloned part from what i can understand, so how is disabling this script preventing the part from disappearing and what is making it disappear in the first place? I also tried changing the script name and it didnt help. I NEED ANSWERS!
local function gen()
local rooms = {"BigRoom","BigRoom","BigRoom","BigRoom","NoRoom"}
local roomnew = game.ReplicatedStorage.rooms[rooms[math.random(1,#rooms)]]:Clone()
roomnew.Parent = workspace.Floor1.rooms
roomnew:PivotTo(script.Parent:GetPivot())
script.Parent:Destroy()
end
script.Parent.Touched:Connect(function(mHit)
if mHit.Name == "Hit" then
gen()
end
end)