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

FireClient can only be called from the server??

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

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)

1 comment

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.

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