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

FireClient can only be called from the server??

Asked by 6 years ago

Hello. I have a issue with scripting. When im in studio and i click the button on the gui on studio it makes a block partly visible to the client. Script is under here.

local event = game.ReplicatedStorage:WaitForChild("RemoteEvent")

event.OnClientEvent:connect(function(player)
    game.Workspace.Route25F.Transparency = .8
    game.Workspace.Route25F.Script.Disabled = false
end)

As you can see it changes a brick's transparency and makes a script enabled. However, When I enter the server nothing works. But i get a message from the output saying "FireClient can only be called from the server." I do not know what that means. Click script from GUI button under here. [LOCAL SCRIPT]

local event = game.ReplicatedStorage:WaitForChild("RemoteEvent")

script.Parent.MouseButton1Down:connect(function()
    event:FireClient(player)
end)

What im trying to do is make it so when the player click the GUI Button only they can see and interact With it. Please Can I have some help?

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

If you're trying to create a custom Client-Client event, use a BindableEvent. RemoteEvents are only for when you need to send an event over the network (Client-Server)

0
Does this make it so only one player can see the brick because when i tried it the whole server could see the brick and interact with it. RobbieTheUltraGamer 7 — 6y
Ad

Answer this question