i have an problem with an starterplayer local script
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RemoteEvent = ReplicatedStorage:WaitForChild("unclaim")
local stores = {
game.Workspace.STORE,
game.Workspace.STORE1
}
for _, store in pairs(stores) do
local claimprox = store.Door.door.door.ProximityPrompt -- Adjust the path to the actual ProximityPrompt
local unclaimprox = store.Door.door.door.UnclaimPrompt -- Adjust the path to the actual UnclaimPrompt
local door = store.Door.door.door -- Adjust the path to the actual door object
local claim = door.claim -- Assuming claim is a Value object within the door
local name = door.name -- Assuming name is a Value object within the door
local text = store.Sign.Sign
local surfaceGui = text.SurfaceGui
-- Function to handle unclaim logic
local function handleUnclaim()
if claim.Value == "true" then
claimprox.Enabled = true
claim.Value = "false"
name.Value = ""
door.CanCollide = true
if surfaceGui then
local textLabel = surfaceGui:FindFirstChild("TextLabel")
if textLabel then
textLabel.Text = "UNCLAIMED!"
end
end
end
end
RemoteEvent.OnClientEvent:Connect(function()
unclaimprox.Enabled = true
handleUnclaim()
end)
end
for some reason its saying: door is not a valid member of Model âWorkspace.STORE.Door.doorâ - Client - LocalScript:10
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RemoteEvent = ReplicatedStorage:WaitForChild("unclaim")
local stores = {
game:GetService("Workspace"):WaitForChild("STORE"),
game:GetService("Workspace"):WaitForChild("STORE1")
}
for _, store in pairs(stores) do
local claimprox = store.Door.door.door.ProximityPrompt -- Adjust the path to the actual ProximityPrompt
local unclaimprox = store.Door.door.door.UnclaimPrompt -- Adjust the path to the actual UnclaimPrompt
local door = store.Door.door.door -- Adjust the path to the actual door object
local claim = door.claim -- Assuming claim is a Value object within the door
local name = door.name -- Assuming name is a Value object within the door
local text = store.Sign.Sign
local surfaceGui = text.SurfaceGui
-- Function to handle unclaim logic
local function handleUnclaim()
if claim.Value == "true" then
claimprox.Enabled = true
claim.Value = "false"
name.Value = ""
door.CanCollide = true
if surfaceGui then
local textLabel = surfaceGui:FindFirstChild("TextLabel")
if textLabel then
textLabel.Text = "UNCLAIMED!"
end
end
end
end
RemoteEvent.OnClientEvent:Connect(function()
unclaimprox.Enabled = true
handleUnclaim()
end)
end
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RemoteEvent = ReplicatedStorage:WaitForChild("unclaim")
local stores = {
game:GetService("Workspace"):WaitForChild("STORE"),
game:GetService("Workspace"):WaitForChild("STORE1")
}
for _, store in pairs(stores) do
task.spawn(function()
task.wait(1)
local claimprox = store.Door.door.door.ProximityPrompt -- Adjust the path to the actual ProximityPrompt
local unclaimprox = store.Door.door.door.UnclaimPrompt -- Adjust the path to the actual UnclaimPrompt
local door = store.Door.door.door -- Adjust the path to the actual door object
local claim = door.claim -- Assuming claim is a Value object within the door
local name = door.name -- Assuming name is a Value object within the door
local text = store.Sign.Sign
local surfaceGui = text.SurfaceGui
-- Function to handle unclaim logic
local function handleUnclaim()
if claim.Value == "true" then
claimprox.Enabled = true
claim.Value = "false"
name.Value = ""
door.CanCollide = true
if surfaceGui then
local textLabel = surfaceGui:FindFirstChild("TextLabel")
if textLabel then
textLabel.Text = "UNCLAIMED!"
end
end
end
end
RemoteEvent.OnClientEvent:Connect(function()
unclaimprox.Enabled = true
handleUnclaim()
end)
end)
end