RemoteEvent not working

I feel like this is new or something but you can’t do Prompt.Triggered on LocalScripts.
I may be wrong.
But because of this, I’m having a RemoteEvent (RemoteEventComputer) fire to the Script so it can detect if the ProximityPrompt is being triggered. Then do (EX - EX.)

LocalScript:

local Text = game.Players.LocalPlayer.PlayerGui.HintGui.TextLabel
local Frame = game.Players.LocalPlayer.PlayerGui.HintGui.Frame
local PromptSwitch = game.Workspace.SwitchTest.ProximityPrompt
local PromptComputer = game.Workspace.monitor.ComputerPart.ProximityPrompt

local player = game.Players.LocalPlayer


	game.ReplicatedStorage.RemoteEventComputer.OnClientEvent:Connect(function() 
	local player = game.Players.LocalPlayer
	local Character = player.Character or player.CharacterAdded:Wait ()
	local Camera = workspace.CurrentCamera
	repeat wait ()
		Camera.CameraType = Enum.CameraType.Scriptable
	until Camera.CameraType == Enum.CameraType.Scriptable
	Camera.CFrame = game.Workspace.monitor.CameraPart.CFrame
	player.Character:WaitForChild("HumanoidRootPart").Anchored = true
	Text.Visible = true
	Frame.Visible = true
-- I removed the text because it's not really needed for the post.
	
	end)

Script:


local PromptSwitch = game.Workspace.SwitchTest.ProximityPrompt
local PromptComputer = game.Workspace.monitor.ComputerPart.ProximityPrompt


PromptSwitch.Triggered:Connect(function()
	PromptComputer.Enabled = true
end)

PromptComputer.Triggered:Connect(function(player)
	 game.ReplicatedStorage.RemoteEventComputer:FireClient(player)
	end)

Any help is appreciated.

Where are these scripts located in the explorer?

1 Like

They are located in the same model.

put the LocalScript in StarterPlayerScripts

1 Like

That works and the text and frame becomes “visible” but not really. I’ve tried using game.StarterGui / game.Players.LocalPlayer.PlayerGui to define it but it doesn’t work.

Could you elaborate what you mean by: the text and frame becomes “visible” but not really?

When I check the properties once the code runs it says it is visible, though it isn’t.

Edit:

note: the computer screens text isn’t what im talking about.

1 Like

Because you are checking Properties in your StarterGui.

The StarterGui will not change, it will remain all the same when you run the game and play it.

What you have inside your StarterGui will copy to your player:

Go to Players, then to your Player Name, then to PlayerGui, there you will see your Gui and Frames…

I’ll try what your suggesting but i’m having play several pieces of text in intervals, that when i look at it in startergui i see it actively updating to change it.

So is the Frame in the workspace?

1 Like

Why is your script in the StarterGui, you can place your Script to workspace because its not a localscript.

And in your model i see a Localscript, the Localscript will not work in Workspace place it to StarterGui or StarterPlayerScripts

1 Like

I already placed the LocalScript into StarterPlayerScripts as suggested by another user. I am testing what you suggested earlier right now.

1 Like