Hello Devs! Today I started creating a new game for my own entertainment, but unfortunately was stuck on a certain script. So I looked up a few tutorials, used some of my previous knowledge in scripting, however, failed miserably. The whole point of my game was “asserting dominance” so I was trying to make a script where when you typed the letter “A”, your character grew bigger (don’t question my game ideas, I’m a very interesting person)
game.Players.PlayerAdded:Connect(function(player)
player.Chatted:Connect(function(msg)
if msg == "A" then
local humanoid = player.Character:FindFirstChild("Humanoid")
--change the things here
end
end)
end)
plrAdded:Conect(blahbalh)
local character = game.Workspace:FindFirstChild(player.Name)
local humanoid
if character ~= nil then
humanoid = character:FindFirstChild("Humanoid")
end
plrMessaged:Connect(blahblah)
end
end
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(Char)
local humanoid = Char:WaitForChild("Humanoid")
player.Chatted:Connect(function(Message)
if Message == "A" then
-- What u want to do
end
end)
end)
It does need to be a server script, but you need to get the Humanoid from the player that chatted, not some random one at the start. If you paste the code I could edit it for your liking. Where is this script placed in the explorer also?
I dont see why would u be by characterAdded event sure that character is not equal to nil, if u would want it that way u should connect two events at once (humanoid.Died and characterAdded) so u would actually know if there is a character. But anyways I am done w this discussion
BOTH
game.Players.PlayerAdded:Connect(function(player)
player.Chatted:Connect(function(msg)
if msg == “A” then
local humanoid = player.Character:FindFirstChild(“Humanoid”)
–change the things here
end
end)
end)
AND
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(Char)
local humanoid = Char:WaitForChild(“Humanoid”)
player.Chatted:Connect(function(Message)
if Message == “A” then
– What u want to do
end
end)
end)
WORKED!
I hope I’m not asking too much from you guys but is there any a person could grow taller based on how many A’s they say? Like if you were to say “AAAAAAA” you would grow seven times