I'm trying to wrap my head around Remote Events & how to use them, so, as a starter challenge, try to do chat-commands from server-to-client; however, the LocalScript doesn't respond, and neither one of the prints in it fire at all, while the ServerScript does.

There's no Output returns, other than the prints as set in the scripts (but again, the LocalScript doesn't appear to fire any), so I can't give any information that would further the question. (There's no coroutines & pcall involved in the scripts.)

Ugh, FE is more of a pain than I thought originally. -_-*

Here're the scripts that I'm working w/:

-- ServerScript
local AdminSettings = require(script:waitForChild('ASettings')) -- Retrieves the administrative information via a table
local Variables = require(script:waitForChild('Vars')) -- Retrieves variables set in to prevent repetitive typings
stringmembers = Variables.stringmembers -- Need I explain?
services = Variables.services -- Durr?
local Functions = {} -- To keep track of the functions; got into this style e-e

Functions.Chat = function(msg,plyr) -- How the functions are stored
	if msg == 'blah' then
		print(plyr.Name,':chatted:',msg)
	end
end

local LocalClientScript=script:WaitForChild('LocalClientScript') -- The LocalScript that's supposed to communicate w/ the ServerScript

Functions.onPlayerJoin = function(plyr)
	if plyr.className ~= 'Player' then return end -- Wasn't sure if I needed to do this b/c of FE
	local NewLocalClientScript = LocalClientScript:Clone()
	NewLocalClientScript.Parent = plyr
	NewLocalClientScript.Disabled = false
	local NewRemoteEvent = Instance.new('RemoteEvent')
	NewRemoteEvent.Name = 'PLRREMOTE'
	NewRemoteEvent.Parent = plyr
	print('snapz') -- Prints
	NewRemoteEvent.OnServerEvent:connect(function(msg)
		Functions.Chat(plyr,msg)
	end)
	print('wowsers') -- Prints
end

services.Players.ChildAdded:connect(Functions.onPlayerJoin) -- Wasn't sure if this was supposed to be done b/c i wanted to make sure it supposed FE
for i,v in pairs(services.Players:children()) do Functions.onPlayerJoin(v) end
-- LocalScript
local plyr = game.Players.LocalPlayer
print('yh') -- Not any one of the prints w/in this script fires
local RemoteEvent = plyr:WaitForChild('PLRREMOTE')
print('loaded')
plyr.Chatted:connect(function(msg)
	print('lol chat')
	RemoteEvent:FireServer(msg)
end)

Ugh, such a pain in the neck... -_-**

2 comments

0

Where is the LocalScript when you expect it to run? Does it have Disabled set to false?

0

@duckwit It shows in the script on lines 19-20...