So I have created this script for filtering enabled and it's in a regular script in a part in the workspace, this should work because I used the method of Server to Client, in fact, it works without filtering enabled? I don't understand why Filtering Enabled breaks this when it's made specifically for it? Can anybody help me out?
local welcomePlayerEvent = Instance.new("RemoteEvent") welcomePlayerEvent.Parent = game.ReplicatedStorage welcomePlayerEvent.Name = "HenryShopEvent" function onHit(hit) welcomePlayerEvent:FireClient(hit) end script.Parent.Touched:connect(onHit)
Yeah here you go this is a fixed version:
see the problem was when your firing to the client you where sending it to a object other then the actual player.
Just did a update Try this:
Server:
local Players = game:GetService("Players") -- ignore local welcomePlayerEvent = Instance.new("RemoteEvent") welcomePlayerEvent.Parent = game.ReplicatedStorage welcomePlayerEvent.Name = "HenryShopEvent" function onHit(hit) local Player = Players:GetPlayerFromCharacter(hit.Parent) if Player then welcomePlayerEvent:FireClient(Player,'Welcome') end end script.Parent.Touched:connect(onHit)
Quick Client script i made :
local remote = game.ReplicatedStorage:WaitForChild('HenryShopEvent') remote.OnClientEvent:connect(function(...) local Args = {...} if Args[1] == 'Welcome' then print('Welcome') end end)