I am trying to make it that when you click the nuke button it alerts the whole server that the player has bought Nuke, But it isn’t working? Script:
local RS = game:GetService("ReplicatedStorage")
local Nuke = RS.HasBoughtNuke
game.StarterGui.Nuke.TextButton.MouseButton1Up:Connect(function()
Nuke:FireAllClients()
end)
Local Script:
local RS = game:GetService("ReplicatedStorage")
local Nuke = RS.HasBoughtNuke
local NukeText = game.Players.LocalPlayer.PlayerGui:WaitForChild("Nuke").TextLabel
local Player = game.Players.LocalPlayer
local function Texting(object, text)
for i = 1, #text, 1 do
object.Text = string.sub(text, 1, i)
wait(0.05)
end
end
Nuke.OnClientEvent:Connect(function()
Texting(NukeText, Player.Name.." Has bought nuke!")
end)
local remote = game.replicatedstorage.ramote
button = yourbutton
button.Activated:connect(function()
remote:FireServer()
end)
remote.OnClientEvent:Connect(function(player)
notify that player has bought the nuke
end)
server:
remote = da remote
remote.OnServerEvent:Connect(function(player)
remote:FireAllClients(player)
end)
this is a very basic example, it doesnt work but it should give you the idea