Script Fires Event In Workspace = Event = Local Script Responds To Event

Hello, Roblox devs,

I am trying to make it so that when a certain task happens, It will tell a local script in starterGUI to perform a task. I want to transport a number value as well.

My initial idea was to start with remote events but they transfer players

The task:
How would I transfer a number value and an on event from Script in workspace to script in starterGUI?

What do you mean by remote events transfer players?

What is your goal?

Not trying to be a smart a but right here:

How would I transfer a number value and an on event from Script in workspace to script in starterGUI?

I want to send a number to a local script from a script in workspace

Yea, I read that. What are you trying to achieve by doing so?

word cap: gew g ewgw g ewg we ewg gewq gw

But I also want to detect when the number is shared

Right I stop asking questions, if this aren’t what you’re looking for, then you did not specify your case correctly.

Remote:FireClient(Player, Number)
1 Like

Is there a way to do a remote event without using a player?

Are you trying to fire this number to all players?

Here is exactly what I am doing:

I have a lightning bolt that is created, I want to send a signal to a local script saying a lightning bolt has happened

It will then determine the distance (which I know how to do) and determine if it is either:

  1. Far
  2. Close
  3. RealyClose

This will then determine the sound that will be played in a sound folder I have

Value:

The value will determine if the bolt was positive or negative. This is determined by the value 1 or 2. This will determine the volume of the sounds (Faint or Loud).

How do I tell my local script if there has been a lightning bolt and if it is positive or negative (1 or 2)

There is multiple approaches to this, but if you want to stick to your remote path:

Remote:FireAllClients(StrikePos)
--local Far = 100 -- Not really used, since it's in the "else" statement
local Nearby = 50
local Close = 10
local Camera = workspace.CurrentCamera
Remote.OnClientEvent:Connect(function(StrikePos)
	local Distance = (Camera.CFrame.Position - StrikePos).Magnitude
	if Distance <= Close then -- Close
		print(Distance)
	elseif Distance <= Nearby then -- Nearby
		print(Distance)
	else -- Far
		print(Distance)
	end
end)
1 Like

Give me about 5 - 10 minutes to try and work this out. Thanks!

Perfect! I thank you for all the help!

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