[FIXED]I have a problem when cloning a map with ServerStorage

Sure :

local Part = script.Parent
local Proxi = Part.ProxiPrompt
local ClickDetector = Part.ClickDetector
local code = math.random(1000,9999)
local text = Part.SurfaceGui.TextLabel
Part.Code.Value = code

Part.ClickDetector.MouseClick:Connect(function()
	Part.Color = Color3.fromRGB(163, 162, 165)
	Proxi.Enabled = true
	Part.logonsound:Play()
	ClickDetector:Destroy()
end)

Proxi.Triggered:Connect(function()
	Part.Color = Color3.fromRGB(0, 85, 255)
	Proxi.Enabled = false
	Part.ding:Play()
	text.Visible = true
	text.Text = code 
end)

it clones it after


		for i, player in pairs(Players:GetPlayers())do
			local clone = mapChosen:Clone()	
			clone.Parent = game.Workspace.CurrentlyLoaded
			clone:MoveTo(pos[i])
	    	print("Initiated map"..mapChosen.Name..i)
		local char = player.Character
			char.HumanoidRootPart.CFrame = clone.Spawn.CFrame
	     end

when the code is generated, print that code, and when the player tries to enter it and gets it wrong, print the code he was supposed to enter and tell me the output

1 Like

image

1st output is the generated code, second is the random code I typed in the GUI and the third is the correct code I typed in the GUI

Note that when the actual correct code is typed, the door actually opens but the text still says that the code is incorrect, I don’t understand why it does that

am not sure, but my guess is, when the remote event is fired, both the original and cloned map script launches, and the cloned map script sets the text to correct, but the original map script quickly changes that to incorrect after.
try when cloning the new map, delete the original one just for a test, or just the script that changes the text

1 Like

I tried your suggestion but sadly it didn’t work rip (btw I think the devforum crashed 5mins ago lol)

sorry for asking too many questions but, can you send me the code that opens the door ? or is it in the code that you sent before ?

1 Like

yea it’s the first script I showed ( it messes up the tweening for some reason)
btw feel free to ask more questions I don’t have any problems with that

1 Like

i will open roblox studio to test a few things

1 Like

when you deleted the script i told you to delete, you were in the server right ?
it just sounds impossible for the door to open and the text be incorrect unless there is another script doing that

1 Like

yes I were in the server side, and yes it both says the code is incorrect but the door still open, i’m so confused lol even after 10 days I still haven’t found the problem

maybe I should ask a big dev or something but right now the only thing I know is that it bugs when the map is a clone from ServerStorage

Does anyone else have other ideas to why my script glitched like that ? I still can’t find why

Wait, is your script a local script?

It’s a normal script in ServerScriptService

i’m stuck on this problem, even though it’s just a cosmetic one, it’s still not user friendly

If someone else has an idea please tell me it still doesn’t work for some reason