Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

how to use artifical chat?

what i am trying to do is everytime you press "r" then a fireball comes out, and a dialogue interface comes out of the head that says "Fireball!" and then destroys after 4 seconds. also the rotation of the fireball is really off

player = script.Parent.Parent
 mouse = player:GetMouse()
 char = player.Character

fireballText = "Fireball!"

function onKeyDown(key)
	key = key:lower()
	if key == "r" then
		head = player.Character:FindFirstChild("Head")
		fireball = game.Lighting.fireball:clone()
		fireball.Parent = game.Workspace
		fireball.CFrame = char.Torso.CFrame.lookVector*CFrame.new(8,0,0)
		fireball.Name = "fireballClone"
		fireball.Velocity = head.CFrame.lookVector*0
		game.GetService("Chat"):Chat(head, fireballText, "Bright red")
		wait(2)
		game.GetService("Chat"):Destroy()
		
	end
end

mouse.KeyDown:connect(onKeyDown)

1 comment

0

You can't destroy a service. Also, 'game.GetService("Chat")' should be 'game:GetService("Chat")', as 'GetService' is a method.

1 answer

For line(s) 16-18

 game:GetService('Chat'):Chat(head,'FIREBALL!','Red')

Also You cant remove the Chat it goes away just as any of the Chat bar(s) above our heads today. Do NOT use

game:GetService('Chat'):Destory() <--- ERROR

This discussion is preserved as it was. New answers, comments, and votes are closed.