i want a script that when you touch a part it makes so that a part turns visible but the part does not turn visible and I get no output
this is my script:
script.Parent.Touched:Connect(function()
game.StarterGui.ScreenGui.Frame.Visible = true
end)
i want a script that when you touch a part it makes so that a part turns visible but the part does not turn visible and I get no output
this is my script:
script.Parent.Touched:Connect(function()
game.StarterGui.ScreenGui.Frame.Visible = true
end)
Hi, your script is close to correct, just that there are some errors. Here is the correct script:
script.Parent.Touched:Connect(function()
for number,player in pairs(game.Players:GetPlayers()) do
player.PlayerGui.ScreenGui.Enabled = true --Set ScreenGui.Enabled to false at first.
end
end)
So basically this is what it does:
1. We get a table of the players using game.Players:GetPlayers()
2. Check for the part being touched
3. Use a generic for loop to handle ScreenGui.Enabled
oh ok thats better
sure
This discussion is preserved as it was. New answers, comments, and votes are closed.
3 comments
StarterGui is not a working thing.It just replicates the GUIs to everyone.So you need to do is player.PlayerGui
oh ok thank you so much
still doesnt work do i keep it the screengui on startergui or do i just leave it there and switch the game.startergui into game.player.startergui?