What do you want to achieve?
What I wish to achieve is getting it to get visible and the text changes however, if I go to properties it shows it’s visible but isn’t visible for the player.
Script is not changing TextBoxs text Include screenshots / videos if possible!
local changeColor = game.Workspace.LOl
local notification1 = game.StarterGui.ScreenGui.TextBox
game.Workspace.Part.Touched:Connect(function(hit)
for pod1 = 10,0,-1 do
notification1.Visible = true
game.StarterGui.ScreenGui.TextBox.Text = "Brick Touched!"
wait(1)
notification1.Text = pod1
end
end)
Good effort – but you fell into the trap that everybody does when they first try something like this!
The StarterGui is not live-updating. If you change it, people won’t see that change until they respawn, at which point roblox copies the contents of the StarterGui into that Player’s PlayerGui.
game.Players.PlayerGui isn’t a thing, you need an actual player.
And game.Players.LocalPlayer.PlayerGui would only work from a LocalScript, which is not what this is.
You need to find the player attached to the part that hit you. Something like this:
game.Workspace.Part.Touched:Connect(function(hit)
if hit.Parent:IsA("Model") and hit.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
-- use player.PlayerGui instead of game.StarterGui here!
end
end
end)