hello, my fellow amer- I mean devs!
so apparently I was making a script that basically clones Gui frames and puts them inside “PlayerGui”. the way I’ve done this is very simple, I basically made a ProximityPrompt so when it gets triggered, it should take the players action named “hit” and then goes to the “hit” parent and eventually to “PlayerGui” where a GUI clone should be put inside, at first it did work…until I added the “If” statement on the script, I added it so it checks if a value is true or false, which is located inside the “PlayerGui”, I don’t know why it stopped honestly since I’m not that much of a scripter, but I do assume that it has something to do with local scripts or whatever.
please check the code and screenshots, it should explain my gibberish explanation
script.Parent.Triggered:Connect(function(hit)
-------------------------------------------------------------- [ON JOB]
if hit.PlayerGui.JobGui.JobExam.InJob == true then
local Frame = script.Parent.InJobFrame:Clone()
Frame.Parent = hit.PlayerGui.JobGui
Frame.PupUp:Play()
end
-------------------------------------------------------------- [OFF JOB]
if hit.PlayerGui.JobGui.JobExam.InJob == false then
if hit.PlayerGui.JobGui.JobExam.JobDone == true then
hit.PlayerGui.JobGui.JobExam.JobDone = false
local Frame = script.Parent.C50:Clone()
Frame.Parent = hit.PlayerGui.JobGui
Frame.PupUp:Play()
else
local Frame = script.Parent.ProgramJob:Clone()
Frame.Parent = hit.PlayerGui.JobGui
Frame.PupUp:Play()
end
end
script.Parent.MaxActivationDistance = 0
wait(5)
script.Parent.MaxActivationDistance = 15
end)
help would be much appreciated