How do I make it so that when someone says something, something happens to JUST them?

I am currently trying to make a “Commands Playground” Type game. I am going to need this a lot but do not understand how to do it.
(sorry for poor explanation in advance) to explain further, I want to make it so when said player says, Example message, it happens to said player.
I have the whole “when player says thing, event happens” thing down,


I just don’t know how to detect that the player said something and the event only happens to that player.
(for reference I am trying to make it so that when a player says, I am speed, their speed increases.)

1 Like

Do you want the effect to be on the player’s client or every other player’s client?

I want everyone to be able to see the difference, I just want the event to only affect them person. (sorry for being so vague)

Also, the effect is only for the player that chatted that so you are good to go with that portion of script.
You just have to make it a server script and not a local script.

So all I have to do is make it so their walkspeed is higher?

Yea, you gotta get their Humanoid and change its WalkSpeed property

so something like this?

 local humanoid = char:WaitForChild("Humanoid")
       humanoid.WalkSpeed = 25

Yea, that’s the way to do it. You can also customize JumpPower

game.Players.PlayerAdded:Connect(function(player)
	player.Chatted:Connect(function(message)
		if string.lower(message) == "I am speed" then
			local humanoid = char:WaitForChild("Humanoid")
			humanoid.WalkSpeed = 50
		end
	end)
end)

final script being this then?
(edit: can’t be right, not working. I can’t tell what I am missing.)

You are missing the variable ‘char’
Here’s the complete script…

You can also use the New TextChatService for this as it has commands for this reason

ServerScript:

local IAmSpeed = Instance.new("TextChatCommand")
IAmSpeed.Parent = game:GetService("TextChatService")
IAmSpeed.PrimaryAlias = "I am speed"

IAmSpeed.Triggered:Connect(function(Source,Text)
	
	local Player = game.Players:FindFirstChild(Source.Name)
	
	local Char = Player.Character
	
	Char:FindFirstChildOfClass("Humanoid").WalkSpeed = 50;
	
	
end)
2 Likes

THis, and Hydrous’s script isn’t working in Testing Mode. I can’t tell what I am doing wrong

image
Please change the ChatVersion to TextChatSerivce

1 Like

works now, Thank you guys so much
!

Btw, would I basically do the same for JUmpPower?

Yes, you would do the same thing.

I replaced the Speed with jumpower and renamed stuff and it isn’ working

It’s JumpPower. It’s the exact spelling ‘JumpPower’

Yeah, thats what I did I think.
image

Is there any errors in the console?