script not updating text? Using remote events, Server to client.
Asked by
6 years ago Edited 6 years ago
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:
01 | local Update = Instance.new( "RemoteEvent" ) |
02 | Update.Parent = game.ReplicatedStorage |
05 | local function UpdateStuff(player) |
06 | Update:FireClient(player) |
09 | Players.PlayerAdded:Connect(UpdateStuff) |
localscript:
01 | local Players = game:GetService( "Players" ) |
02 | local ReplicatedStorage = game:GetService( "ReplicatedStorage" ) |
03 | local amount = game.Players.LocalPlayer.PlayerGui.MainGui.Buttons [ "CLICK for CRATE BUX" ] .amount |
04 | local player = Players.LocalPlayer |
05 | local UpdateText = ReplicatedStorage:WaitForChild( "Update" ) |
06 | local playerGui = player:WaitForChild( "PlayerGui" ) |
07 | local Cost = playerGui.MainGui.Upgrades.Disc.Cost |
08 | local function Update() |
09 | playerGui.MainGui.Upgrades.Disc.Text = "+30 CRATE BUX per click (" ..amount.Value.. ")" |
10 | playerGui.MainGui.Upgrades.Disc [ 'Buy for' ] .TextButton.TextButton.Text = "Upgrade for " ..Cost.Value.. "CB" |
11 | playerGui.MainGui.Buttons [ 'CLICK for CRATE BUX' ] .Text = "Click for " ..amount.Value.. "CB" |
16 | UpdateText.OnClientEvent:Connect(Update) |
Any help to moi(me) will be amazing.