Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why is FireServer() in a local script not activating another local script?

I have a LOCAL SCRIPT in a BUTTON. I have another LOCAL SCRIPT in STARTERGUI. I have a EVENT in a FOLDER in RS. I want the LOCAL SCRIPT in the ***BUTTON ***to activate the LOCAL SCRIPT in STARTER GUI! Sorry for making so many things bold, its just because some people aren't understanding what I need fixed. Anyways

Local Script in the Button:

Player = game.Players.LocalPlayer
script.Parent.Text=tostring(script.Parent.ItemName.Value)..": Gamepass"

script.Parent.MouseButton1Click:connect(function()
	game.ReplicatedStorage.Events.Trails.CustomTrailEvent:FireServer(script.Parent.Parent.Parent.Parent.Parent.Parent.Name)
	print("WRWIJF!")
end)

Local Script in the StarterGui: (Only the first part of the script.)

game.ReplicatedStorage:WaitForChild("Events").Trails.CustomTrailEvent.OnClientEvent:Connect(function(guiname)
	local Player = game.Players.LocalPlayer
	local playerid = Player.UserId
	local id = 4785126
	print(guiname)
end)

Local Script in StarterGui got cut off, here is the rest: OnClientEvent:Connect(function(guiname)

I should have explained better last time. Also if I get flagged for this being answered already that makes no scense because it didn't. Thanks!

1 comment

0

You can’t fire OnClientEvent to the server.

1 answer

✓ Accepted answer

You are trying to communicate between the same client using a RemoteEvent, these are only for client to server communication. Rather than using this, use a BindableEvent instead.

You can read about bindable events here: http://wiki.roblox.com/index.php?title=API:Class/BindableEvent

8 comments

0

Is it FE compatible?

0

It will only show up on the client who does it because you are going from one localscript to another, within the same client. What are you trying to make with this? (No, going from a localscript to another localscript on the same client is never FE compatible)

0

Are you trying to get this to show up on other people's screen?

0

No.

0

Wait.

0

If I edit a trail on a player in this, will the trail show up for other people?

0

No.

0

You have to have a script in ServerScriptService do it

This discussion is preserved as it was. New answers, comments, and votes are closed.