#Creating a quoting system, having issues with the Event being fired properly.
65 messages · Page 1 of 1 (latest)
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)
** You are now Level 4! **
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
Same I’m bad at math functions
Climate
I’m confused
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
Let’s call for Fix It Felix
ok
** You are now Level 2! **
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)
You can't print this?
it can print but i cant read
you fire a server event while this connect is for client
what does that mean
@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
@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)
oh i see the Problem its the Character.Head
@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)
since u didnt call the Character OnServerEvent
What is in the server script ?
i need my non dyslexic glasses
Every time I send you the script, I change Something so don't get mad
to read the script that @pulsar dome made
Fire server -> client send to server
On client event -> server send to client
i see alittle change each time
So what is the error output
Oh have u done a FireAllClients
Yes because FireClient is different
@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
Try
FireAllClients instead of fire server?
Well, I have to go bye for now
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
Fire server
Server receive it
Server fire all clients
now thats a bad example
It's easier on mobile because you can just use the microphone wtf