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

how to make a gui load items and add new pages with functions for each button?

Asked by 9 years ago

local P = game.Players.LocalPlayer; repeat wait() until P.Character; local C = P.Character; local player = script.Parent.Parent.Parent.Parent.Parent.Parent local player2 = game.Players:FindFirstChild(player.Character.Name) local id = script.Parent.Link.Value local screen = script.Parent local scr = script.Parent.Page1 local a1 = scr.a1; local a2 = scr.a2; local b1 = scr.b1; local b2 = scr.b2; local c1 = scr.c1; local c2 = scr.c2; local d1 = scr.d1; local d2 = scr.d2; local e1 = scr.e1 local e2 = scr.e2 local f1 = scr.f1 local f2 = scr.f2 local g1 = scr.g1 local g2 = scr.g2 local h1 = scr.h1 local FaceID = screen.FaceBox;

a1.name.Value = "Evil Skeptic"
a1.hat.Value = "110336757"
a1.Class.Value = "Face"
a1.Price.Value = "Unknown"

a2.name.Value = "Bubble Trouble"
a2.hat.Value = "19264845"
a2.Class.Value = "Face"
a2.Price.Value = "Unknown"

b1.name.Value = "Beast Mode"
b1.hat.Value = "128992838"
b1.Class.Value = "Face"
b1.Price.Value = "Unknown"

b2.name.Value = "Red Fang"
b2.hat.Value = "16722419"
b2.Class.Value = "Face"
b2.Price.Value = "Unknown"

c1.name.Value = "Mr. Bubbles"
c1.hat.Value = "31616411"
c1.Class.Value = "Face"
c1.Price.Value = "Unknown"

c2.name.Value = "Red Tango"
c2.hat.Value = "16652251"
c2.Class.Value = "Face"
c2.Price.Value = "Unknown"

d1.name.Value = "Eyes of Azurewrath"
d1.hat.Value = "17999992"
d1.Class.Value = "Face"
d1.Price.Value = "Unknown"

d2.name.Value = "Optimist"
d2.hat.Value = "21024661"
d2.Class.Value = "Face"
d2.Price.Value = "Unknown"

e1.name.Value = "Grandma's Lipstick"
e1.hat.Value = "51241480"
e1.Class.Value = "Face"
e1.Price.Value = "Unknown"

e2.name.Value = "Yum!"
e2.hat.Value = "26019070"
e2.Class.Value = "Face"
e2.Price.Value = "Unknown"

f1.name.Value = "Prankster"
f1.hat.Value = "20052135"
f1.Class.Value = "Face"
f1.Price.Value = "Unknown"

f2.name.Value = "Epic Face"
f2.hat.Value = "42070576"
f2.Class.Value = "Face"
f2.Price.Value = "Unknown"

g1.name.Value = "Awkward...."
g1.hat.Value = "23932048"
g1.Class.Value = "Face"
g1.Price.Value = "Unknown"

g2.name.Value = "Mr. Chuckles"
g2.hat.Value = "10907541"
g2.Class.Value = "Face"
g2.Price.Value = "Unknown"

h1.name.Value = ">:3"
h1.hat.Value = "15177601"
h1.Class.Value = "Face"
h1.Price.Value = "Unknown"

function GetItem(className,ID) if ID ~= 0 then Item = game:GetService("InsertService"):LoadAsset(ID):GetChildren()[1] if Item:IsA(className) then return Item else return false end else return 0 end end

function IsClass(item,className) if item then if item:IsA(className) then return true else return false end end end

a1.MouseButton1Up:connect(function() if game:GetService("GamePassService"):PlayerHasPass(player2,id)then if type(tonumber(FaceID.Text)) == "number" then Blarg = GetItem("Decal",tonumber(FaceID.Text)) if IsClass(Blarg,"Decal") then pcall(function() C.Head:FindFirstChild("face"):remove() end) Blarg.Parent = C.Head else game:GetService("MarketplaceService"):PromptPurchase(player2,id) end end end end)

a2.MouseButton1Up:connect(function() if game:GetService("GamePassService"):PlayerHasPass(player2,id)then if type(tonumber(FaceID.Text)) == "number" then Blarg = GetItem("Decal",tonumber(FaceID.Text)) if IsClass(Blarg,"Decal") then pcall(function() C.Head:FindFirstChild("face"):remove() end) Blarg.Parent = C.Head else game:GetService("MarketplaceService"):PromptPurchase(player2,id) end end end end)

b1.MouseButton1Up:connect(function() if game:GetService("GamePassService"):PlayerHasPass(player2,id)then if type(tonumber(FaceID.Text)) == "number" then Blarg = GetItem("Decal",tonumber(FaceID.Text)) if IsClass(Blarg,"Decal") then pcall(function() C.Head:FindFirstChild("face"):remove() end) Blarg.Parent = C.Head else game:GetService("MarketplaceService"):PromptPurchase(player2,id) end end end end)

b2.MouseButton1Up:connect(function() if game:GetService("GamePassService"):PlayerHasPass(player2,id)then if type(tonumber(FaceID.Text)) == "number" then Blarg = GetItem("Decal",tonumber(FaceID.Text)) if IsClass(Blarg,"Decal") then pcall(function() C.Head:FindFirstChild("face"):remove() end) Blarg.Parent = C.Head else game:GetService("MarketplaceService"):PromptPurchase(player2,id) end end end end)

c1.MouseButton1Up:connect(function() if game:GetService("GamePassService"):PlayerHasPass(player2,id)then if type(tonumber(FaceID.Text)) == "number" then Blarg = GetItem("Decal",tonumber(FaceID.Text)) if IsClass(Blarg,"Decal") then pcall(function() C.Head:FindFirstChild("face"):remove() end) Blarg.Parent = C.Head else game:GetService("MarketplaceService"):PromptPurchase(player2,id) end end end end)

c2.MouseButton1Up:connect(function() if game:GetService("GamePassService"):PlayerHasPass(player2,id)then if type(tonumber(FaceID.Text)) == "number" then Blarg = GetItem("Decal",tonumber(FaceID.Text)) if IsClass(Blarg,"Decal") then pcall(function() C.Head:FindFirstChild("face"):remove() end) Blarg.Parent = C.Head else game:GetService("MarketplaceService"):PromptPurchase(player2,id) end end end end)

d1.MouseButton1Up:connect(function() if game:GetService("GamePassService"):PlayerHasPass(player2,id)then if type(tonumber(FaceID.Text)) == "number" then Blarg = GetItem("Decal",tonumber(FaceID.Text)) if IsClass(Blarg,"Decal") then pcall(function() C.Head:FindFirstChild("face"):remove() end) Blarg.Parent = C.Head else game:GetService("MarketplaceService"):PromptPurchase(player2,id) end end end end)

d2.MouseButton1Up:connect(function() if game:GetService("GamePassService"):PlayerHasPass(player2,id)then if type(tonumber(FaceID.Text)) == "number" then Blarg = GetItem("Decal",tonumber(FaceID.Text)) if IsClass(Blarg,"Decal") then pcall(function() C.Head:FindFirstChild("face"):remove() end) Blarg.Parent = C.Head else game:GetService("MarketplaceService"):PromptPurchase(player2,id) end end end end)

e1.MouseButton1Up:connect(function() if game:GetService("GamePassService"):PlayerHasPass(player2,id)then if type(tonumber(FaceID.Text)) == "number" then Blarg = GetItem("Decal",tonumber(FaceID.Text)) if IsClass(Blarg,"Decal") then pcall(function() C.Head:FindFirstChild("face"):remove() end) Blarg.Parent = C.Head else game:GetService("MarketplaceService"):PromptPurchase(player2,id) end end end end)

e2.MouseButton1Up:connect(function() if game:GetService("GamePassService"):PlayerHasPass(player2,id)then if type(tonumber(FaceID.Text)) == "number" then Blarg = GetItem("Decal",tonumber(FaceID.Text)) if IsClass(Blarg,"Decal") then pcall(function() C.Head:FindFirstChild("face"):remove() end) Blarg.Parent = C.Head else game:GetService("MarketplaceService"):PromptPurchase(player2,id) end end end end)

g1.MouseButton1Up:connect(function() if game:GetService("GamePassService"):PlayerHasPass(player2,id)then if type(tonumber(FaceID.Text)) == "number" then Blarg = GetItem("Decal",tonumber(FaceID.Text)) if IsClass(Blarg,"Decal") then pcall(function() C.Head:FindFirstChild("face"):remove() end) Blarg.Parent = C.Head else game:GetService("MarketplaceService"):PromptPurchase(player2,id) end end end end)

g2.MouseButton1Up:connect(function() if game:GetService("GamePassService"):PlayerHasPass(player2,id)then if type(tonumber(FaceID.Text)) == "number" then Blarg = GetItem("Decal",tonumber(FaceID.Text)) if IsClass(Blarg,"Decal") then pcall(function() C.Head:FindFirstChild("face"):remove() end) Blarg.Parent = C.Head else game:GetService("MarketplaceService"):PromptPurchase(player2,id) end end end end)

h1.MouseButton1Up:connect(function() if game:GetService("GamePassService"):PlayerHasPass(player2,id)then if type(tonumber(FaceID.Text)) == "number" then Blarg = GetItem("Decal",tonumber(FaceID.Text)) if IsClass(Blarg,"Decal") then pcall(function() C.Head:FindFirstChild("face"):remove() end) Blarg.Parent = C.Head else game:GetService("MarketplaceService"):PromptPurchase(player2,id) end end end end)


0
...What the... Redbullusa 1580 — 9y

Answer this question