Issue with Remote Events

I am currently having an issue with the remote events in my game.

For context: I’m trying to fire a remote event from a server script to trigger a local script but no matter what I try it does not work.

I made print statements to print out when it fires and when it receives the signal from the remote event and it only prints when the remote event is fired.

Here are my scripts:
Server script

local prox = script.Parent
local down = script.Parent.Parent.Parent.HouseGoInsideTeleport
local snod1 = down.dooropen
local snod2 = down.doorclose
local tranrem = game.ReplicatedStorage.transition
local TweenService = game:GetService("TweenService")
local textLabel = game.StarterGui.Transition.tran
prox.Triggered:Connect(function(plr)
	tranrem:FireClient(plr)
	print("fired")
	wait(0.33)
	snod1:Play()
	plr.Character.HumanoidRootPart.CFrame = CFrame.new(down.Position)
	wait(0.5)
	snod2:Play()
end)

LocalScript

local tranrem = game.Workspace.Interactables.Teleporters.HouseGoInside.ProximityPrompt.transition
local TweenService = game:GetService("TweenService")
local textLabel = game.StarterGui.Transition.tran

tranrem.OnClientEvent:Connect(function()
	print("recieved")
	TweenService:Create(textLabel, TweenInfo.new(0.3), {Transparency = 0}):Play()
	wait(1)
	TweenService:Create(textLabel, TweenInfo.new(0.3), {Transparency = 1}):Play()
end)

I’d greatly appreciate any sort of help with this issue.

It doesn’t seem like you are connecting to the same event:

Server:

Client:

2 Likes

Yeah, that was just me being blind. My mistake. I fixed it, it prints the received statement but it does not execute the rest of the script.

Probably because you are changing the startergui instead of the player’s gui lol.
This should do the trick:

local textLabel = game:GetService("Players").LocalPlayer.PlayerGui.Transition.tran
2 Likes

Hey Cabrexada,

I think the problem is that you’re trying to change the StarterGui instead of the player’s GUI. The StarterGui is a template GUI that is used to create new GUIs for each player when they join the game. Once a player’s GUI is created, it is no longer connected to the StarterGui.

To fix this, you need to get a reference to the player’s GUI. You can do this using the Players.LocalPlayer.PlayerGui property.

Here is a revised version of your local script:

local tranrem = game.Workspace.Interactables.Teleporters.HouseGoInside.ProximityPrompt.transition
local TweenService = game:GetService("TweenService")
local textLabel = game:GetService("Players").LocalPlayer.PlayerGui.Transition.tran

tranrem.OnClientEvent:Connect(function()
	print("recieved")
	TweenService:Create(textLabel, TweenInfo.new(0.3), {Transparency = 0}):Play()
	wait(1)
	TweenService:Create(textLabel, TweenInfo.new(0.3), {Transparency = 1}):Play()
end)

This should work correctly.

Give it a try and let me know if you have any other questions.

Good luck!

1 Like

Can we please stop using chatgpt to respond to people and instead just take the time to write out a normal response, thanks.

1 Like

Thank you very much, didn’t think the best solution was to ask on the devforum lol.

I have my own normal layout for my responses that I always use to stay formal, and I’m using that layout in this response. I’m learning to be more casual in my responses, mostly for game announcements/decisions. I’d rather use the devforum to help users, instead of auguring so I won’t turn this into a argument.

Have a great day!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.