I am trying to make a slenderman game and I want the page to delete once someone collects it for themself but for everyone else in the server it is still there. My script doesn’t work does anyone know how to do this?
You can do the code you put on a server script, and then fire a remote event to the client to locally delete it. Not sure if it’s the best way to go, but it works.
LocalScripts do not work inside of workspace. Try putting the script in ServerScriptService, defining the proximityprompt variable, and handling it from there.
Maybe also try putting the LocalScript in StarterPlayerScripts.
Put the script inside the ‘StarterPlayerScripts’ container and reference the prompt/part from there, i.e;
local Game = game
local Workspace = workspace
local Players = Game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local Part = Workspace:WaitForChild("Part")
local Prompt = Part:WaitForChild("ProximityPrompt")
local function OnTriggered(Player)
if Player ~= LocalPlayer then return end
Part:Destroy()
end
Prompt.Triggered:Connect(OnTriggered)