Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 5 years ago
Edited 5 years ago

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!

0
You can’t fire OnClientEvent to the server. User#19524 175 — 5y

1 answer

Log in to vote
1
Answered by
Scarious 243 Moderation Voter
5 years ago
Edited 5 years ago

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

0
Is it FE compatible? kittonlover101 201 — 5y
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) Scarious 243 — 5y
0
Are you trying to get this to show up on other people's screen? Scarious 243 — 5y
0
No. kittonlover101 201 — 5y
View all comments (4 more)
0
Wait. kittonlover101 201 — 5y
0
If I edit a trail on a player in this, will the trail show up for other people? kittonlover101 201 — 5y
0
No. Scarious 243 — 5y
0
You have to have a script in ServerScriptService do it Scarious 243 — 5y
Ad

Answer this question