Big struggles with Local Data and firing RemoteEvents

I’ve reworked my games scripts like 4 times now, and I’m just tired and want to find a reasonable solution, or understand what I’m doing wrong.

As shown in the image below, there are 5 Steps, all walkthrough. I have 5 ProximityPrompts hidden around in each Map, and when the ProximityPrompt is activated (they’re one-use), a Step will become walkable. This is my alternate method of unlocking new areas, because I ran into 9,000 issues with my local area gate scripts.

image

I have tried setting up a RemoteEvent so many times with this setup so I could have more reliable tracking on my Prompts, with zero results, even though it seems to be a standard method of sending local data to the server, I just haven’t been able to get my RemoteEvents to fire at all.

This is my ChatGPT prompt. I’ve rewritten it and debugged it too many times to count now, just looking for some solid advice in direction.

When a Player activates a ProximityPrompt located in Workspace > Findables > Map1 (Find1, Find2, Find3, Find4, Find5), I want the Steps in Workspace > StairsGate > Stairs1 (Step1, Step2, Step3, Step4, Step5) to become Cancollide = True, and Transparency = 0, so every Prompt that is pressed, a Step is made walkable, but make sure each time it’s a different Step that isn’t Walkable yet

Note: Script works just dandy in a Server script, but I obviously want to handle these changes separately for each player.

Why would u want re to deal with secrets? Can u pls show me script?

Why don’t you just do this? (Insert script inside said Proximity Prompt)

local proxPrompt = script.Parent

proxPrompt.Triggered:Connect(function(enableStep)
	local targetedStep = --Mention the part you want to modify here
		
		targetedStep.CanCollide = true
	targetedStep.Transparency = 0
	
	proxPrompt.Enabled = false
end)

I’m gonna give this a shot, I quickly tried a method of a Localscript inside each Prompt that would activate each Step, but didn’t spend time on it. I like how direct this approach is

Edit: Didn’t activate specified Step, could something be wrong with my organization?

local proxPrompt = script.Parent

proxPrompt.Triggered:Connect(function(enableStep)
	local targetedStep = workspace.StairsGate.Stairs1.Step1--Mention the part you want to modify here

		targetedStep.CanCollide = true
	targetedStep.Transparency = 0

	proxPrompt.Enabled = false
end)

StairsGate is a Folder in Workspace, Stairs1 is a Folder that contains all 5 Steps.
Script is LocalScript inside ProximityPrompt

Try doing 'workspace.StairsGate.Stairs1:WaitForChild(“Step1”)

The first issue I came across when I had Gates that would become invisible/walkthrough for a Player that activated all 5 ProximityPrompts was that after a few Maps, the data that was being stored in a local table would lose track of Prompts activated, and even though a Player activated all 5 Prompts, the Gate wouldn’t open for them (they’d have to rejoin + recollect prompts to fix). You can actually test this in its current state-- the game usually breaks around Map 5 (the Shipyard).

Actually, local scripts won’t work if you put them directly inside the proximity prompt, i forgot.

Place the script inside StarterGUI and mention the proximity prompt in the ‘proxPrompt’ variable

So I’d have to uniquely name the ProximityPrompts yeah?

Edit: Nvm i see, i’ll test it out

Yes, but if you want to make the whole thing easier and more practical for multiple use i recommend coding in OOP and using modules, but that might be too complicated for your level.

Hold up, trying something again think I screwed up with Part names

Used ChatGPT to turn it into something that can find all the Steps/Prompts in one script, thank you so much! Big help, hopefully that’s the last of the issues for the core of my game and I can move on. :slight_smile:

I’m glad that could be solved. If you encounter any more issues, don’t hesitate to @ me.