Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

how to use artifical chat?

Asked by
reloce 0
9 years ago

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)
0
You can't destroy a service. Also, 'game.GetService("Chat")' should be 'game:GetService("Chat")', as 'GetService' is a method. Redbullusa 1580 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

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

Ad

Answer this question