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

Why RemoteEvent doesn't fire from TextButton?

Local Script

local event = game.ReplicatedStorage.Events.ACTransfer
local button = script.Parent

button.MouseButton1Click:Connect(function()
	event:FireServer()
end)

Server Script

local event = game.ReplicatedStorage.Events.ACTransfer

event.OnServerEvent:Connect(function(player)
	print(player.Name)
end)

No print

1 answer

Weird, works fine for me.

Is the local script inside of the textbutton and is the Server Script in Workspace or ServerScriptService

5 comments

0

local script is in text button and server scruot is in workspace

0

text button is in surface gui, could be that a problem?

0

yes, that is a problem. local scripts cant run in the workspace.

1

to fix that, you could put it (local script) in sarterplayerscripts and do something like local button = workspace.Part.SurfaceGui.TextButton

1

Correction: LocalScripts run in the workspace if they are a descendant of an object owned by a player such as the player's character. The object you have in the workspace is not owned by any player, therefore it does not run.

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