Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

What is wrong with this script?

local toolname = "Luger, Colt 45"  
script.Parent.Touched:connect( function(hit)  
    if hit.Parent then 
        local player = Game.Players:GetPlayerFromCharacter(hit.Parent)  
        if player and not player:FindFirstChild("No") then 
            if player.Character:FindFirstChild(toolname) then 
                local gui = player.PlayerGui.StoreRobberyGUI 
                local no = Instance.new("IntValue", player) 
                no.Name = "No" 
                Spawn(function() 
                    wait(10) 
                    no:Destroy() 
                end) 
            end 
        end 
    end 
end)  

I put this in the brick that I needed to touch it, the StoreRobberyGUI is the actual name of the GUI, but when I touch the brick holding one of the guns, it doesn't appear...

2 comments

0

did you receive any output?

0

No

1 answer

You're not doing anything with gui yet as defined on line 7. Does it exist? If so, what's your method of making it appear all of a sudden? Is the visible property already set to false or is the transparency value 1?

This discussion is preserved as it was. New answers, comments, and votes are closed.