In this script I am trying to pass a RemoteEvent once you say "Hello" But nothing is working, and theres no errors.
Script:
local replicatedstorage = game:GetService("ReplicatedStorage")
local RemoteEventConnection = game.ReplicatedStorage:WaitForChild("CommissionTest")
local player = game.Players.LocalPlayer
local GamePassId = 6766156 -- Replace with your gamepass
local WhitelistUserIDs = { --Your PlayerId's here
79523404,
0,
1,
2
}
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId, GamePassId) == true or table.find(WhitelistUserIDs, player.UserId) then
print("First")
function onChatted(message, player)
if message == "Hello" and game.MarketplaceService:UserOwnsGamePassAsync(player.UserId, GamePassId) then
print("message sent")
RemoteEventConnection:FireServer(GamePassId,WhitelistUserIDs)
end
end
end
game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(function(message) onChatted(message, player)
end)
end)

2 comments
Is this a client script or a server script?
its from the client, he uses LocalPlayer in the first few lines