Soooo, long story short I want this script to update text for my game and it doesn't work for some reason and it gives no errors,
script:
local Update = Instance.new("RemoteEvent")
Update.Parent = game.ReplicatedStorage
Update.Name = "Update"
local function UpdateStuff(player)
Update:FireClient(player)
end
while wait(0.5)do
Players.PlayerAdded:Connect(UpdateStuff)
end
localscript:
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local amount = game.Players.LocalPlayer.PlayerGui.MainGui.Buttons["CLICK for CRATE BUX"].amount
local player = Players.LocalPlayer
local UpdateText = ReplicatedStorage:WaitForChild("Update")
local playerGui = player:WaitForChild("PlayerGui")
local Cost = playerGui.MainGui.Upgrades.Disc.Cost
local function Update()
playerGui.MainGui.Upgrades.Disc.Text = "+30 CRATE BUX per click ("..amount.Value..")"
playerGui.MainGui.Upgrades.Disc['Buy for'].TextButton.TextButton.Text = "Upgrade for "..Cost.Value.."CB"
playerGui.MainGui.Buttons['CLICK for CRATE BUX'].Text = "Click for "..amount.Value.."CB"
end
UpdateText.OnClientEvent:Connect(Update)
Any help to moi(me) will be amazing.

3 comments
wait() shouldn't be a condition, and you don't have to loop the PlayerAdded event.
But then it wouldn't update if the amount or cost increased or decreased If I don't add a loop the PlayerAdded
What do you mean? PlayerAdded fires whenever a player joins. You don’t have to loop it will fire automatically.