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

Why does this not work?

Asked by
Mowblow 117
10 years ago
 local cd = script.Parent

function onclick(Player)
print("PassedTheFunction")
if Player.PlayerGui:FindFirstChild("BoomGui") == nil and game.Workspace:FindFirstChild("LocalSoundForBoomBox") == nil then
    print("les get it started in ere")
    game.ReplicatedStorage.BoomGUI:Clone().Parent = Player.PlayerGui
    print("It should give it to us!")
end
end

cd.MouseClick:connect(onclick)

The script runs, I see all of the prints in the output, no errors in the output, doesn't give the the "BoomGUI". Please help.

4 answers

Log in to vote
1
Answered by 10 years ago

Make local cd = script.Parent to cd = script.Parent

0
Nope, I actually solved the problem, the gui was invisible! Sorry, guys. Mowblow 117 — 10y
Ad
Log in to vote
0
Answered by 10 years ago

make it a local function

 local cd = script.Parent

local function onclick(Player)
print("PassedTheFunction")
if Player.PlayerGui:FindFirstChild("BoomGui") == nil and game.Workspace:FindFirstChild("LocalSoundForBoomBox") == nil then
    print("les get it started in ere")
    game.ReplicatedStorage.BoomGUI:Clone().Parent = Player.PlayerGui
    print("It should give it to us!")
end
end

cd.MouseClick:connect(onclick)

0
Still doesn't work, even with a local function. Mowblow 117 — 10y
Log in to vote
0
Answered by 10 years ago

Nothing wrong with it lol

Log in to vote
0
Answered by
KAAK82 16
10 years ago
 local cd = script.Parent

function onclick(Player)
print("PassedTheFunction")
if Player.PlayerGui:FindFirstChild("BoomGui") == nil and game.Workspace:FindFirstChild("LocalSoundForBoomBox") == nil then
    print("les get it started in ere")
    game.ReplicatedStorage.BoomGUI:clone().Parent = Player.PlayerGui --clone() not Clone()
    print("It should give it to us!")
end
end

cd.MouseClick:connect(onclick)

Answer this question