Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How would you go about affecting everyone's UI? My script only runs for one person?

Asked by 5 years ago
Edited 5 years ago

Hello,

This script is supposed to run for all players in the game, but it only seems to run for the latest person that joined? It's strange, and I'm starting to feel like I may be on the wrong path? The script is supposed to affect everyone's UI. How would you go about fixing my script? Or is there a better approach?

I'm quite new to scripting, so all help and explanations are very much appreciated.

This is a server script in ServerScriptService. When there is only one player in the game, it works fine. Here is my current script:

001--// Variables
002 
003local RepStorage = game:GetService("ReplicatedStorage")
004local Players = game:GetService("Players")
005 
006local TextGui = script.NPCtext:Clone()
007local ServerText = script.ServerText:Clone()
008local PlayerText = script.PlayerText:Clone()
009local TextSound = script.TextSound
010local Text = ""
011 
012--// Game Set-up
013 
014Players.PlayerAdded:Connect(function(player)
015    TextGui.Parent = player.PlayerGui
View all 104 lines...

1 answer

Log in to vote
1
Answered by
EthanFins 104
5 years ago

You will Have to make it run inside of a local script or it won't work correctly. If you need it to play the same time then you will have to make a Remote Event that fires at all the clients

Ad

Answer this question