I’m trying to create a command that makes a chain of chat bubbles appear out of the top of them when they run a command.
So far, I’m not exactly sure how to do this, as I need to check if the player runs a command, and if they do, a chain of messages comes out from on top of them.
I can’t seem to find any resources that can help me with this, and I’m very new to scripting.
Do note: I’m not asking for a full script, I’m asking for resources that could help explain how to do this.
I’m making an automated training system, so a Trainer runs -train and all the information will automatically come out of them. This is for users who don’t have discord so won’t be able to access a guide for training, and just makes the process easier.
Hello, this might help. But if you want to look for a more detailed tutorial try this tutorial. I hope this helps!
local PlayerService = game:GetService("Players")
PlayerService.PlayerAdded:Connect(function(plr)
plr.Chatted:Connect(function(msg)
if msg == "COMMAND" then
--Script Here
end
end)
end)
Huh? That’s not what I meant at all. I think I misunderstood the script. I thought you had to touch the part in order to make the message come out of the player, but now I see the message is coming out of the part. How do I make the player chat the messages?
Wait, never mind that. So I edited the script and it turned out like this.
local PlayerService = game:GetService("Players")
local ChatService = game:GetService("Chat")
PlayerService.PlayerAdded:Connect(function(plr)
plr.Chatted:Connect(function(msg)
if msg == "-train" then
local Character = plr.Character
local part = Character.Head
part.Anchored = true
part.Parent = workspace
wait(3)
ChatService:Chat(part, "Test", "Black")
end
end)
end)
But when saying -train in the chat, the player gets killed and I receive the error: “Unable to cast string” in the output.
No, you don’t want to make this, there’s no point in trying to create this unless you don’t understand fundamentals, I would reccommend learning how to code before learning how to create things.
Well, you should learn how to code properly or at least learn how to understand core functions of code, otherwise it will just be us completely solving the code, that get’s you nowhere when trying to learn code.