Hello! I’m trying to make an announcement system. The principle is that via a ScreenGui I put my message and I click on send and then it will look for another ScreenGui to make the message appear on the screen of the players.
The problem is that my script works but does not show the message so the 2nd ScreenGui
Script of SendButton :
local player = game.Players.LocalPlayer
local leaderstats = player:WaitForChild("leaderstats")
script.Parent.Parent.SendButton.MouseButton1Click:Connect(function()
player.leaderstats.Money.Value = player.leaderstats.Money.Value - 50
game.StarterGui.InfoUI.Info.Visible = true
end)
local players = game:GetService("Players")
local player = players.LocalPlayer
local leaderstats = player:WaitForChild("leaderstats")
script.Parent.Parent.SendButton.MouseButton1Click:Connect(function()
leaderstats.Money.Value -= 50
player:WaitForChild("PlayerGui").InfoUI.Info.Visible = true
end)
Also, I see you’re changing the player’s stats on the client, which is not very good/efficient, exploiters can easily ruin this. Try to use a remote event.