Hi! In my ProximityPromt script, I can’t seem to index the PlayerGui.
What’s wrong?
Thanks!
(not the full script, it’s what this is being used for. the other stuff in unimportant towards this error.)
THIS IS A SERVER SCRIPT
workspace.feedbacknPC.Torso.ProximityPrompt.Triggered:Connect(function(player)
local ui = plr.PlayerGui:WaitForChild("Feedback", 15)
ui.MainFrame:TweenPosition(UDim2.new(0.344, 0, 0.673, 0), "Out", "Quart", .5, true) --0.673
end)
Full script (just my proximityprompt things)
wait(5)
workspace.City.Cafe.Cafe.Sink1.ProxPart.ProximityPrompt.ActionText = "Turn On Fossit"
workspace.City.Cafe.Cafe.Sink2.ProxPart.ProximityPrompt.ActionText = "Turn On Fossit"
wait()
workspace.City.Cafe.Cafe.Sink1.FossitPart.ParticleEmitter.Enabled = false
workspace.City.Cafe.Cafe.Sink1.ProxPart.ProximityPrompt.Triggered:Connect(function(player)
--- turn on
if workspace.City.Cafe.Cafe.Sink1.ProxPart.ProximityPrompt.ActionText == "Turn On Fossit" then
wait()
print("Someone has turned on the fossit.")
workspace.City.Cafe.Cafe.Sink1.FossitPart.ParticleEmitter.Enabled = true
workspace.City.Cafe.Cafe.Sink1.ProxPart.ProximityPrompt.ActionText = "Turn Off Fossit"
wait()
---turn off
elseif workspace.City.Cafe.Cafe.Sink1.ProxPart.ProximityPrompt.ActionText == "Turn Off Fossit" then
wait()
print("Someone has turned off the fossit.")
workspace.City.Cafe.Cafe.Sink1.FossitPart.ParticleEmitter.Enabled = false
workspace.City.Cafe.Cafe.Sink1.ProxPart.ProximityPrompt.ActionText = "Turn On Fossit"
wait()
end
end)
------------------------------------------SINK2--------------------------------------------------
workspace.City.Cafe.Cafe.Sink2.FossitPart.ParticleEmitter.Enabled = false
workspace.City.Cafe.Cafe.Sink2.ProxPart.ProximityPrompt.Triggered:Connect(function(player)
--- turn on
if workspace.City.Cafe.Cafe.Sink2.ProxPart.ProximityPrompt.ActionText == "Turn On Fossit" then
wait()
print("Someone has turned on the fossit.")
workspace.City.Cafe.Cafe.Sink2.FossitPart.ParticleEmitter.Enabled = true
workspace.City.Cafe.Cafe.Sink2.ProxPart.ProximityPrompt.ActionText = "Turn Off Fossit"
wait()
---turn off
elseif workspace.City.Cafe.Cafe.Sink2.ProxPart.ProximityPrompt.ActionText == "Turn Off Fossit" then
wait()
print("Someone has turned off the fossit.")
workspace.City.Cafe.Cafe.Sink2.FossitPart.ParticleEmitter.Enabled = false
workspace.City.Cafe.Cafe.Sink2.ProxPart.ProximityPrompt.ActionText = "Turn On Fossit"
wait()
end
end)
workspace.City.Cafe.Cafe.Sink1.ProxPart.ProximityPrompt.Triggered:Connect(function(player)
end)
local plr = game.Players.LocalPlayer
workspace.e.ProximityPrompt.Triggered:Connect(function(player)
for i = 1,1000 do
plr = game.Players.LocalPlayer
workspace.f.SurfaceGui.TextLabel.Text = ("returned true turns out you NOT STINKI")
wait()
if plr == nil then
workspace.f.SurfaceGui.TextLabel.Text = ("lol returned nil noob bad scripting")
break
end
end
end)
workspace.feedbacknPC.Torso.ProximityPrompt.Triggered:Connect(function(player)
local ui = plr.PlayerGui:WaitForChild("Feedback", 15)
ui.MainFrame:TweenPosition(UDim2.new(0.344, 0, 0.673, 0), "Out", "Quart", .5, true) --0.673
end)
Thanks for any help!