Hi everyone,
To summarize, I want to make a game where players can place boards on the windows, but only if you have a board in your backpack. If you don’t have a board in your backpack, then a notice pops up saying that there are no boards in your inventory.
This script is inside the board that the player will try activate.
local integrity = script.Parent.Parent.Parent.Integrity
local ReplicatedStorage = game:GetService('ReplicatedStorage')
script.Parent.Triggered:Connect(function(player)
if player.BoardValue.Value >= 1 then
script.Parent.Parent.Transparency = 0
script.Parent.Enabled = false
integrity.Value = integrity.Value + 2
if player.BoardValue.Value > 0 then
player.BoardValue.Value = player.BoardValue.Value - 1
end
elseif player.BoardValue.Value == 0 then
print('Yaya') -- print statement runs perfectly
ReplicatedStorage.Announce:FireClient('Hello') -- this is the problem
end
end)
Script inside ServerScript Service
-- runs announcements
local ReplicatedStorage = game:GetService('ReplicatedStorage')
local Players = game:GetService('Players')
local announce = ReplicatedStorage:WaitForChild('Announce')
function Announce(message)
game.ReplicatedStorage.Announce:FireAllClients(message)
end
Local script to print message:
function setAnnouncer(message)
print(message)
end
game.ReplicatedStorage.Announce.OnClientEvent:Connect(setAnnouncer)
OutPut:
If you need anymore information, please let me know. Thanks .