Ad
Log in to vote
0

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

Asked by 10 days ago
Edited 10 days 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. incapaz 3232 — 10d

1 answer

Log in to vote
1
Answered by
Scarious 203 Moderation Voter
10 days ago
Edited 10 days 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 48 — 10d
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 203 — 10d
0
Are you trying to get this to show up on other people's screen? Scarious 203 — 10d
0
No. kittonlover101 48 — 10d
View all comments (4 more)
0
Wait. kittonlover101 48 — 10d
0
If I edit a trail on a player in this, will the trail show up for other people? kittonlover101 48 — 10d
0
No. Scarious 203 — 10d
0
You have to have a script in ServerScriptService do it Scarious 203 — 10d
Ad

Answer this question