Hey there,
So I’m looking to make a piece of code that announces when a player purchases a Developer Product;
For example +25 HP, I was given this code by a friend of mine that scripts however it doesn’t seem to work and he doesn’t know why. Could I get some support on this?
local Player = game.Players.LocalPlayer
local Replicated = game.Replicated.Storage
local SendAnnouncment = Replicated.SendAnnouncment ---- This is a or should be a Remote Function located in the replicated storage
local GUI = script.Parent
local Buy+25HealthButton = GUI.Buy+25HEalth
Buy+25HealthButton.MouseButton1Click:Connect(function()
local Message = Player.Name.." bought the +25 Item!"
SendAnnouncment:InvokeServer(Message)
end)
**In the Script located inside Server Script Service**
local Replicated = game.ReplicatedStorage
local SendAnnouncement = Replicated.SendAnnouncemnet
local ReceiveAnnouncment = Replicated.ReceiveAnnouncement -- This is a or should be a Remote Event located in the replicated storage
SendAnnouncment.OnServerInvoke = function(player, Message)
ReceiveAnnouncement:FireAllClients(Message)
end
**An announcment recieve Local Script inside another Gui**
local Replicated = game.ReplicatedStorage
local ReceiveAnnouncement = Replicated.ReceiveAnnounement
ReceiveAnnounement.OnClientEvent:Connect(function(Message)
-----Function to show the announcment-----
end)```
If I were to make this so that the following were added how do I do this?
Increase of 25 HP
Get Back In
Instant Deathmatch
Thank you all for the support.