Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why arent my changes seen to the entire server gui?

local localPlayerBidValue = tonumber(script.Parent.Parent.Text)
    local SoldHit = script.Parent.Parent.Parent.SoldWords
    local WholeFrame = script.Parent.Parent.Parent
    local tool = game.ReplicatedStorage.MediterraneanAvenue
    
    remoteEvent:FireServer(localPlayerBidValue, guiMoneyValue,SoldHit,WholeFrame,tool)

local script, server:

local function onCreatePart(player, localPlayerBidValue, guiMoneyValue,SoldHit,WholeFrame,tool)
    if localPlayerBidValue > BasePrice then
        local playerThatBidded = tostring(player.Name)
        print(localPlayerBidValue.." is greater than "..BasePrice)
        
        BasePrice = localPlayerBidValue
        guiMoneyValue.Value = BasePrice
        ReplicatedStorage.BidValue.topBidder.Value = playerThatBidded
        print(ReplicatedStorage.BidValue.topBidder.Value)
        SoldHit.Visible = true
        SoldHit.Text = "Sold Once..."
        wait(2)
        SoldHit.Visible = false
        wait(1)
        SoldHit.Visible = true
        SoldHit.Text = "Sold Twice..."
        wait(2)
        SoldHit.Visible = false
        wait(1)
        SoldHit.Visible = true
        SoldHit.Text = "Sold Thrice..."
        wait(2)
        SoldHit.Visible = false
        WholeFrame.Visible = false
        tool.Parent = player

why cant these changes be seen to all clients except for BasePrice = localPlayeBidValue?

1 comment

0

What type of Gui is it?

1 answer

You don't have to use remote events, simple use an in pairs() loop to loop through all of game.Players children (players) and then in their PlayerGui edit it.

EDIT:

Here is an example local script in the TextButton or whatever:

script.Parent.MouseButton1Click:Connect(function() --Connects the clicked function
	local plr = game.Players.LocalPlayer --Finds the player
	for i, v in pairs(game.Players:GetChildren()) do -- loops through all players in the server
		v.PlayerGui.TextButton.Text = plr.Name.." has clicked this button!" --change TextButton to whatever the button is.
	end -- ends the loop
end) -- ends the clicked function

If you have any more questions please tell me.

2 comments

0

should this be in a local or server script and where should it be placed?

0

while looping, how can I get the player who hits themousebutton?

This discussion is preserved as it was. New answers, comments, and votes are closed.