#Creating a quoting system, having issues with the Event being fired properly.

65 messages · Page 1 of 1 (latest)

wicked zephyr
#

So what does it error on

#

@pulsar dome can u join on so u can see anything else that I don’t see

pulsar dome
#

try this

local UIS = game:GetService("UserInputService")
local Character = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()

while not Character:FindFirstChild("Head") do
    Character.ChildAdded:Wait()
end

local Debounce = false

local billboard = Instance.new("BillboardGui")
billboard.Name = "SoundBillboard"
billboard.Adornee = Character.Head
billboard.Size = UDim2.new(2, 0, 1, 0)
billboard.StudsOffset = Vector3.new(0, 2, 0)

local quote = Instance.new("TextLabel")
quote.Name = "Quote"
quote.Text = "Made in Heaven!"
quote.Size = UDim2.new(1, 0, 1, 0)
quote.Font = Enum.Font.GothamSemibold
quote.TextScaled = true
quote.TextColor3 = Color3.new(1, 1, 1)
quote.BackgroundTransparency = 1

billboard.Parent = Character.Head
quote.Parent = billboard
billboard.Enabled = false -- disable the billboard by default

local soundEvent = game.ReplicatedStorage:WaitForChild("SoundEvent")

UIS.InputBegan:Connect(function(input)
    if input.KeyCode == Enum.KeyCode.Q and not Debounce then
        Debounce = true
        if Character then
            soundEvent:FireServer(Character)
        end
    end
end)

soundEvent.OnClientEvent:Connect(function(player)
    print("OnClientEvent called!")    
    local sound = game.ReplicatedStorage:WaitForChild("Made in Heaven"):Clone()
    sound.Parent = Character.Head
    sound:Play()
    billboard.Enabled = true -- enable the billboard when the sound starts playing
    
    sound.Ended:Connect(function()
        Debounce = false
        sound:Destroy()
        billboard.Enabled = false -- disable the billboard when the sound ends
    end)
end)

soundEvent.OnServerEvent:Connect(function(player)
    print("SoundEvent fired!")
    soundEvent:FireClient(player)
end)
eager flumeBOT
#

studio** You are now Level 4! **studio

pulsar dome
#
local UIS = game:GetService("UserInputService")
local Character = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
local Debounce = false

local billboard = Instance.new("BillboardGui")
billboard.Name = "SoundBillboard"
billboard.Adornee = Character.Head
billboard.Size = UDim2.new(2, 0, 1, 0)
billboard.StudsOffset = Vector3.new(0, 2, 0)

local quote = Instance.new("TextLabel")
quote.Name = "Quote"
quote.Text = "Made in Heaven!"
quote.Size = UDim2.new(1, 0, 1, 0)
quote.Font = Enum.Font.GothamSemibold
quote.TextScaled = true
quote.TextColor3 = Color3.new(1, 1, 1)
quote.BackgroundTransparency = 1

billboard.Parent = Character.Head
quote.Parent = billboard
billboard.Enabled = false -- disable the billboard by default

local soundEvent = game.ReplicatedStorage:WaitForChild("SoundEvent")

UIS.InputBegan:Connect(function(input)
    if input.KeyCode == Enum.KeyCode.Q and not Debounce then
        Debounce = true
        if Character then
            soundEvent:FireServer(Character)
        end
    end
end)

soundEvent.OnClientEvent:Connect(function(player)
    print("OnClientEvent called!")    
    local sound = game.ReplicatedStorage:WaitForChild("Made in Heaven"):Clone()
    sound.Parent = Character.Head
    sound:Play()
    billboard.Enabled = true -- enable the billboard when the sound starts playing
    
    sound.Ended:Connect(function()
        Debounce = false
        sound:Destroy()
        billboard.Enabled = false -- disable the billboard when the sound ends
    end)
end)
#

bruh @wicked zephyr Help me out here. I don't know what I'm doing I'm really bad with you Ui

wicked zephyr
pulsar dome
#

The on climate event. Why are you making me do that

#

I'm really bad with those

wicked zephyr
pulsar dome
#

@wicked zephyr i hate you rn

#

brb

wicked zephyr
#

I’m confused

pulsar dome
#

local UIS = game:GetService("UserInputService")
local Character = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
local Debounce = false

local billboard = Instance.new("BillboardGui")
billboard.Name = "SoundBillboard"
billboard.Adornee = Character.Head
billboard.Size = UDim2.new(2, 0, 1, 0)
billboard.StudsOffset = Vector3.new(0, 2, 0)

local quote = Instance.new("TextLabel")
quote.Name = "Quote"
quote.Text = "Made in Heaven!"
quote.Size = UDim2.new(1, 0, 1, 0)
quote.Font = Enum.Font.GothamSemibold
quote.TextScaled = true
quote.TextColor3 = Color3.new(1, 1, 1)
quote.BackgroundTransparency = 1

billboard.Parent = Character.Head
quote.Parent = billboard
billboard.Enabled = false -- disable the billboard by default

local soundEvent = game.ReplicatedStorage:WaitForChild("SoundEvent")

UIS.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.Q and not Debounce then
Debounce = true
if Character then
soundEvent:FireServer(Character)
end
end
end)

soundEvent.OnClientEvent:Connect(function(player)
print("OnClientEvent called!")
local sound = game.ReplicatedStorage:WaitForChild("Made in Heaven"):Clone()
sound.Parent = Character.Head
sound:Play()
billboard.Enabled = true -- enable the billboard when the sound starts playing

sound.Ended:Connect(function()
    Debounce = false
    sound:Destroy()
    billboard.Enabled = false -- disable the billboard when the sound ends
end)

end)

#

Bro, if you know how to fix it, just fix it

#

Then why do you keep telling me nope? What if it works

wicked zephyr
pulsar dome
eager flumeBOT
#

studio** You are now Level 2! **studio

wicked zephyr
#

I can’t read because of my disability

pulsar dome
#

What do you mean by that? He has a disability

#

@wicked zephyr

local UIS = game:GetService("UserInputService")
local Character = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
local Debounce = false

local billboard = Instance.new("BillboardGui")
billboard.Name = "SoundBillboard"
billboard.Adornee = Character.Head
billboard.Size = UDim2.new(2, 0, 1, 0)
billboard.StudsOffset = Vector3.new(0, 2, 0)

local quote = Instance.new("TextLabel")
quote.Name = "Quote"
quote.Text = "Made in Heaven!"
quote.Size = UDim2.new(1, 0, 1, 0)
quote.Font = Enum.Font.GothamSemibold
quote.TextScaled = true
quote.TextColor3 = Color3.new(1, 1, 1)
quote.BackgroundTransparency = 1

billboard.Parent = Character.Head
quote.Parent = billboard
billboard.Enabled = false -- disable the billboard by default

local soundEvent = game.ReplicatedStorage:WaitForChild("SoundEvent")

UIS.InputBegan:Connect(function(input)
    if input.KeyCode == Enum.KeyCode.Q and not Debounce then
        Debounce = true
        if Character then
            print("Firing SoundEvent...")
            soundEvent:FireServer(Character)
        end
    end
end)

soundEvent.OnClientEvent:Connect(function(player)
    print("OnClientEvent called!")    
    local sound = game.ReplicatedStorage:WaitForChild("Made in Heaven"):Clone()
    sound.Parent = Character.Head
    sound:Play()
    billboard.Enabled = true -- enable the billboard when the sound starts playing
    
    sound.Ended:Connect(function()
        Debounce = false
        sound:Destroy()
        billboard.Enabled = false -- disable the billboard when the sound ends
    end)
end)
fathom finch
#

You can't print this?

fathom finch
#

you fire a server event while this connect is for client

wicked zephyr
#

what does that mean

fathom finch
wicked zephyr
wicked zephyr
#

just only make it from only from Server to Client

#
local UIS = game:GetService("UserInputService")
local Character = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
local Debounce = false

local billboard = Instance.new("BillboardGui")
billboard.Name = "SoundBillboard"
billboard.Adornee = Character.Head
billboard.Size = UDim2.new(2, 0, 1, 0)
billboard.StudsOffset = Vector3.new(0, 2, 0)

local quote = Instance.new("TextLabel")
quote.Name = "Quote"
quote.Text = "Made in Heaven!"
quote.Size = UDim2.new(1, 0, 1, 0)
quote.Font = Enum.Font.GothamSemibold
quote.TextScaled = true
quote.TextColor3 = Color3.new(1, 1, 1)
quote.BackgroundTransparency = 1

billboard.Parent = Character.Head
quote.Parent = billboard
billboard.Enabled = false -- disable the billboard by default

local soundEvent = game.ReplicatedStorage:WaitForChild("SoundEvent")

UIS.InputBegan:Connect(function(input)
    if input.KeyCode == Enum.KeyCode.Q and not Debounce then
        Debounce = true
        if Character then
            print("Firing SoundEvent...")
            soundEvent:FireServer(Character)
        end
    end
end)

soundEvent.OnClientEvent:Connect(function(player)
    print("OnClientEvent called!")    
    local sound = game.ReplicatedStorage:WaitForChild("Made in Heaven"):Clone()
    sound.Parent = Character.Head
    sound:Play()
    billboard.Enabled = true -- enable the billboard when the sound starts playing
    
    sound.Ended:Connect(function()
        Debounce = false
        sound:Destroy()
        billboard.Enabled = false -- disable the billboard when the sound ends
    end)
end)```
#

it prints

#

yes

#

even thou i cant read

pulsar dome
#

@wicked zephyr

local UIS = game:GetService("UserInputService")
local Character = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
local Debounce = false

local billboard = Instance.new("BillboardGui")
billboard.Name = "SoundBillboard"
billboard.Adornee = Character.Head
billboard.Size = UDim2.new(2, 0, 1, 0)
billboard.StudsOffset = Vector3.new(0, 2, 0)

local quote = Instance.new("TextLabel")
quote.Name = "Quote"
quote.Text = "Made in Heaven!"
quote.Size = UDim2.new(1, 0, 1, 0)
quote.Font = Enum.Font.GothamSemibold
quote.TextScaled = true
quote.TextColor3 = Color3.new(1, 1, 1)
quote.BackgroundTransparency = 1

billboard.Parent = Character.Head
quote.Parent = billboard
billboard.Enabled = false -- disable the billboard by default

local soundEvent = game.ReplicatedStorage:WaitForChild("SoundEvent")

UIS.InputBegan:Connect(function(input)
    if input.KeyCode == Enum.KeyCode.Q and not Debounce then
        Debounce = true
        if Character then
            print("Firing SoundEvent...")
            soundEvent:FireServer(Character)
        end
    end
end)

soundEvent.OnClientEvent:Connect(function(player)
    print("OnClientEvent called!")    
    local sound = game.ReplicatedStorage:WaitForChild("Made in Heaven"):Clone()
    sound.Parent = Character.Head
    sound:Play()
    billboard.Enabled = true -- enable the billboard when the sound starts playing
    
    sound.Ended:Connect(function()
        Debounce = false
        sound:Destroy()
        billboard.Enabled = false -- disable the billboard when the sound ends
    end)
end)
wicked zephyr
#

oh i see the Problem its the Character.Head

pulsar dome
#

@wicked zephyr

local UIS = game:GetService("UserInputService")
local Character = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
local Debounce = false

local billboard = Instance.new("BillboardGui")
billboard.Name = "SoundBillboard"
billboard.Adornee = Character.Head
billboard.Size = UDim2.new(2, 0, 1, 0)
billboard.StudsOffset = Vector3.new(0, 2, 0)

local quote = Instance.new("TextLabel")
quote.Name = "Quote"
quote.Text = "Made in Heaven!"
quote.Size = UDim2.new(1, 0, 1, 0)
quote.Font = Enum.Font.GothamSemibold
quote.TextScaled = true
quote.TextColor3 = Color3.new(1, 1, 1)
quote.BackgroundTransparency = 1

billboard.Parent = Character.Head
quote.Parent = billboard
billboard.Enabled = false -- disable the billboard by default

local soundEvent = game.ReplicatedStorage:WaitForChild("SoundEvent")

UIS.InputBegan:Connect(function(input)
    if input.KeyCode == Enum.KeyCode.Q and not Debounce then
        Debounce = true
        if Character then
            print("Firing SoundEvent...")
            soundEvent:FireServer(Character)
        end
    end
end)

soundEvent.OnClientEvent:Connect(function(player)
    print("OnClientEvent called!")    
    local sound = game.ReplicatedStorage:WaitForChild("Made in Heaven"):Clone()
    sound.Parent = Character.Head
    sound:Play()
    billboard.Enabled = true -- enable the billboard when the sound starts playing
    
    sound.Ended:Connect(function()
        Debounce = false
        sound:Destroy()
        billboard.Enabled = false -- disable the billboard when the sound ends
    end)
end)
wicked zephyr
#

since u didnt call the Character OnServerEvent

fathom finch
#

What is in the server script ?

wicked zephyr
#

i need my non dyslexic glasses

pulsar dome
#

Every time I send you the script, I change Something so don't get mad

wicked zephyr
#

to read the script that @pulsar dome made

fathom finch
#

Fire server -> client send to server
On client event -> server send to client

pulsar dome
#

yesaaa

#

no

wicked zephyr
#

i see alittle change each time

#

So what is the error output

#

Oh have u done a FireAllClients

#

Yes because FireClient is different

pulsar dome
#

@wicked zephyr Try this and tell me what it prints

local UIS = game:GetService("UserInputService")
local Character = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
local Debounce = false
print(Players)
local billboard = Instance.new("BillboardGui")
billboard.Name = "SoundBillboard"
billboard.Adornee = Character.Head
print(billboard)
print(Adornee)
print(Character)
print(Head)
billboard.Size = UDim2.new(2, 0, 1, 0)
billboard.StudsOffset = Vector3.new(0, 2, 0)

local quote = Instance.new("TextLabel")
quote.Name = "Quote"
quote.Text = "Made in Heaven!"
quote.Size = UDim2.new(1, 0, 1, 0)

quote.Font = Enum.Font.GothamSemibold
quote.TextScaled = true
quote.TextColor3 = Color3.new(1, 1, 1)
quote.BackgroundTransparency = 1

billboard.Parent = Character.Head
quote.Parent = billboard
billboard.Enabled = false -- disable the billboard by default

local soundEvent = game.ReplicatedStorage:WaitForChild("SoundEvent")

UIS.InputBegan:Connect(function(input)
    if input.KeyCode == Enum.KeyCode.Q and not Debounce then
        Debounce = true
        if Character then
            print("Firing SoundEvent...")
            soundEvent:FireServer(Character)
        end
    end
end)

soundEvent.OnClientEvent:Connect(function(player)
    print("OnClientEvent called!")    
    local sound = game.ReplicatedStorage:WaitForChild("Made in Heaven"):Clone()
    sound.Parent = Character.Head
    sound:Play()
    billboard.Enabled = true -- enable the billboard when the sound starts playing
    
    sound.Ended:Connect(function()
        Debounce = false
        sound:Destroy()
        billboard.Enabled = false -- disable the billboard when the sound ends
    
end)
end)
#

@wicked zephyr Try this and tell me what it prints

local UIS = game:GetService("UserInputService")
local Character = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
local Debounce = false
print(Players)
local billboard = Instance.new("BillboardGui")
billboard.Name = "SoundBillboard"
billboard.Adornee = Character.Head
print(billboard)
print(Adornee)
print(Character)
print(Head)
billboard.Size = UDim2.new(2, 0, 1, 0)
billboard.StudsOffset = Vector3.new(0, 2, 0)

local quote = Instance.new("TextLabel")
quote.Name = "Quote"
quote.Text = "Made in Heaven!"
quote.Size = UDim2.new(1, 0, 1, 0)
quote.Font = Enum.Font.GothamSemibold
quote.TextScaled = true
quote.TextColor3 = Color3.new(1, 1, 1)
quote.BackgroundTransparency = 1

billboard.Parent = Character.Head
quote.Parent = billboard
billboard.Enabled = false -- disable the billboard by default

local soundEvent = game.ReplicatedStorage:WaitForChild("SoundEvent")

UIS.InputBegan:Connect(function(input)
    if input.KeyCode == Enum.KeyCode.Q and not Debounce then
        Debounce = true
        if Character then
            print("Firing SoundEvent...")
            soundEvent:FireServer(Character)
        end
    end
end)

soundEvent.OnClientEvent:Connect(function(player)
    print("OnClientEvent called!")    
    local sound = game.ReplicatedStorage:WaitForChild("Made in Heaven"):Clone()
    sound.Parent = Character.Head
    sound:Play()
    billboard.Enabled = true -- enable the billboard when the sound starts playing
    
    sound.Ended:Connect(function()
        Debounce = false
        sound:Destroy()
        billboard.Enabled = false -- disable the billboard when the sound ends
    
end)
end)
#

All the ones I say nil fix

#

That could be the reason why

fathom finch
#

Try
FireAllClients instead of fire server?

pulsar dome
#

Well, I have to go bye for now

fathom finch
#

Add a server script fire all clients

like
--server script
soundEvent.onServerEvent: Connect (function()
SoudEvent:FireAllClient()
end)

#

Because fire server fires to server not clients

pulsar dome
#

It wasn't firing it

#

bruh Now I feel stupid

#

@wicked zephyr

fathom finch
#

Fire server
Server receive it
Server fire all clients

pulsar dome
#

It's easier on mobile because you can just use the microphone wtf