I'm making a script where when you say "Show" and the player's name. It's prints the second value in that string. For example, if I said "show thebeans202" The output should print the beans202. Although, It's NOT printing.. nor is it outputting errors. Any help greatly appreciated.
Here's my script.
local Player = game:GetSerivce('Players').LocalPlayer local debounce = false Player.Chatted:Connect(function(message) message = message:lower() if message:find('show') then local tabl3 = message:split(" ") print(tabl3[2]) end end)
What a coincidence, I needed to do something like this just now. Here's the script that I used, this should work. The value newv is the second part of the command or tabl3[2]
If this doesn't work, I would consider changing this to a Script, not a local script and just use PlayerAdded to get the LocalPlayer who chatted
local Player = game.Players.LocalPlayer local debounce = false Player.Chatted:Connect(function(message) if message:find('show') then local tabl3 = message:split(" ") local newv if tabl3[1] == 'show' then print(tabl3[2]) newv = tabl3[2] end end end)