Help me understand the confusing remote events

Here’s the problem. So basically i’m trying to understand remote functions and events for a very long time but I still don’t understand them. And the roblox developer hub article doesn’t help very much either. Anyways i’m trying to make a textlabel be “blinking” by just changing colors from one to another in a while loop until a player presses any key (Which I also cant do since it also has to be in a remote event) which is gonna just destroy the whole GUI. Here’s my script. As you can see I have also no clue what i’m doing.

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")

local remoteEvent = ReplicatedStorage:WaitForChild("RemoteEventPressToStartCode")

local function onPlayerAdded(player)
	while true do
		script.Parent.TextColor3 = Color3.fromRGB(255,255,255)
		wait(0.5)
		script.Parent.TextColor3 = Color3.fromRGB(0,0,0)
		wait(0.5)
	end
	remoteEvent:FireClient(player)
end

Players.PlayerAdded:Connect(onPlayerAdded)

This was in the ServerscriptService and i don’t know where to put the Localscript and what would be the right way to tell the code that i want to do that to textlabel.

2 Likes

You need to put the local script in either the GUI or in StarterPlayerScrips. I prefer player scripts in advance, as it is far easier to manage for future use. Also, the function is likely wrong, as in the parameter you need to add Gui which in the client (localscript) you would be able to send the GUI. If you do;

Script.Parent.TextColor3 = (/code_obj)

The function won’t know what you’re referring to. So it will likely return with an error; Script.Parent is not a valid member of [Player.Name].

1 Like

Yea but the problem is that i don’t know what to put in local script. I tried to make sense in roblox developer hub article but… well… nothing made sense to me lol

1 Like

Yeah is a hard thing, to be honest