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

Why will this script not execute correctly?

Asked by 9 years ago

It should be checking to see if the player currently has one or the other GUI inside of their PlayerGui, if the player has a 1 or the other, then nothing will happen. But, if the player happens to not have any of these, it is suppose to clone from ReplicatedStorage and put in inside of that players GUI Here's the script: (Read very bottom for more info)

script.Parent.Touched:connect(function(Hit)
local Character = Hit.Parent
local Playar = game.Players:GetPlayerFromCharacter(Character) 
local Start = Playar.PlayerGui
    if Start["R$GUI"] == nil and Start["HelpGUI"] == nil then
        local RobuxGUI = game.ReplicatedStorage["R$GUI"]:Clone()
        RobuxGUI.Parent = Start
    elseif Start["R$GUI"] ~= nil or Start["HelpGUI"] ~= nil then
        print("Player Already Has This!")
    end
end)

I have changed from and to or yet nothing neither does the right thing. When this check for the R$GUI and it's not there, an error gets tossed saying "This is not part of the playergui" and some crap like that about line 5. It should CLONE the GUI inside of the player, not freak out that's it nil when it suppose to see that it's not nil and continue on. I have even inserted manually the GUI's and I get problems. Need more info? Comment please. I really need this fixed; extremely annoying and frustrating.

Answer this question