So I am making a game where there are buttons that spawn around the map and if you step on one, something happens to you. (Size change, speed boost, etc.)
-
What do you want to achieve?
I want to have a gui that says what the button you just stepped on did to you. -
What is the issue?
I got it working fine, but the issue is that it updates for every person in the game. So if someone else steps on a button it will show it for everyone else. I also think that there is a better and more efficient way to do this but I don’t know what.

-
What solutions have you tried so far?
I’ve tried looking on the Developer Forum but there was nothing I could find.
Here is the coding in the local script:
local LastButton = game.ReplicatedStorage.LastButton -- This is a string value in ReplicatedStorage
while true do
wait(0.01)
script.Parent.Text = LastButton.Value
end
And here is the coding for the button in workspace:
local LastButton = game.ReplicatedStorage.LastButton
script.Parent.Touched:Connect(function(player)
local StandardOutcome = math.random(1,15)
if StandardOutcome == 1 then
local Character = player.Parent --player will be player's body part that touches
local Humanoid = Character:FindFirstChild("Humanoid")
if Humanoid then --checks if humanoid exists
local Scale = math.random(1,4)
print("Size " .. Scale)
local HeightScale = Humanoid:FindFirstChild("BodyHeightScale")
HeightScale.Value = HeightScale.Value + Scale - 0.5
local WidthScale = Humanoid:FindFirstChild("BodyWidthScale")
WidthScale.Value = HeightScale.Value + Scale - 0.5
local DepthScale = Humanoid:FindFirstChild("BodyDepthScale")
DepthScale.Value = HeightScale.Value + Scale - 0.5
local HeadScale = Humanoid:FindFirstChild("HeadScale")
HeadScale.Value = HeightScale.Value + Scale - 0.5
script.Parent.Parent:Destroy()
LastButton.Value = "Last Button: Size Change" -- Changes the value in ReplicatedStorage
end
end
end)