Why won't tools clone to inventory with a Chatted function through fe?
This is the script in serverscriptservice
1 | game.Players.PlayerAdded:connect( function (player) |
3 | local rmtevent = game:GetService( 'ReplicatedStorage' ):WaitForChild( 'IsSpawn' ) |
6 | rmtevent.OnServerEvent:connect( function () |
7 | game.Lighting.GunMagsStorage.GunStorage.Deagle:Clone().Parent = game.Players [ player.Name ] .Backpack |
This is the script in startergui which fires the remote event
01 | local rmtevent = game:GetService( 'ReplicatedStorage' ):WaitForChild( 'IsSpawn' ) |
02 | local isSpawner = { [ "Prestory" ] = true , [ "iiFrzyii" ] = true , [ "dom1107" ] = true , [ "MacRRP" ] = true , [ "RobSnappin" ] = true , [ "A_TrueGentlemen" ] = true } |
04 | function onChatted(message, player) |
05 | if message = = "/sg Gucci" and isSpawner [ player.Name ] then |
09 | game.Players.PlayerAdded:connect( function (player) |
10 | player.Chatted:connect( function (message) onChatted(message, player) end ) |
This script is meant to check if there name is on the list then when they type /sg gucci a gun clones to there inventory for some reason it does not work and no error is given in the output may someone help thanks.