local doorcolor = workspace.room1["room logic and lie system"].door:WaitForChild("doorcolor")
local cp2 = workspace.room2.room.cp2
local unlockDoorEvent = game.ReplicatedStorage:WaitForChild("UnlockDoor")
local gui = game.StarterGui.ScreenGui.noentry
-- Track which players have unlocked the door
local unlockedPlayers = {}
-- Listen for door unlock requests from clients
unlockDoorEvent.OnServerEvent:Connect(function(player)
-- Mark this player as having unlocked the door
unlockedPlayers[player.UserId] = true
end)
mainframe.Touched:Connect(function(hit)
local character = hit.Parent
local humanoid = character and character:FindFirstChild("Humanoid")
if not humanoid then return end
local player = game.Players:GetPlayerFromCharacter(character)
if not player then return end
-- Check if this specific player has unlocked the door
if not unlockedPlayers[player.UserId] then
gui.Visible = true task.wait(3) gui.Visible = false
return end
character:SetPrimaryPartCFrame(cp2.CFrame + Vector3.new(0,5,0))
end)
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(plr)
local folder = Instance.new("Folder")
folder.Name = "leaderstats"
local stage = Instance.new("IntValue")
stage.Name = "Stage"
stage.Parent = folder
folder.Parent = plr
stage.Value = 1
end)
#idk please help me this code isnt working
1 messages · Page 1 of 1 (latest)
local doorcolor = workspace.room1["room logic and lie system"].door:WaitForChild("doorcolor")
local cp2 = workspace.room2.room.cp2
local unlockDoorEvent = game.ReplicatedStorage:WaitForChild("UnlockDoor")
local gui = game.StarterGui.ScreenGui.noentry
-- Track which players have unlocked the door
local unlockedPlayers = {}
-- Listen for door unlock requests from clients
unlockDoorEvent.OnServerEvent:Connect(function(player)
-- Mark this player as having unlocked the door
unlockedPlayers[player.UserId] = true
end)
mainframe.Touched:Connect(function(hit)
local character = hit.Parent
local humanoid = character and character:FindFirstChild("Humanoid")
if not humanoid then return end
local player = game.Players:GetPlayerFromCharacter(character)
if not player then return end
-- Check if this specific player has unlocked the door
if not unlockedPlayers[player.UserId] then
gui.Visible = true task.wait(3) gui.Visible = false
return end
character:SetPrimaryPartCFrame(cp2.CFrame + Vector3.new(0,5,0))
end)
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(plr)
local folder = Instance.new("Folder")
folder.Name = "leaderstats"
local stage = Instance.new("IntValue")
stage.Name = "Stage"
stage.Parent = folder
folder.Parent = plr
stage.Value = 1
end)
please help me
what are these variable names bro
club penguin right? 
no, its actually Contextual Processing Layer One
cp2 means cheakpoint2 :)
anyways i fixed the error :D
Nope 👎😔😭😕
👎 Nope 👎😔😞😭😕😔😕😕