Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- wait(0.5)
- --Start of CreateButton
- function CreateDict(Table)
- local PlayerF = {}
- for i,v in next, Table do
- if not v:IsA("Folder") then
- PlayerF[v.Name] = v.Value
- end
- end
- return PlayerF
- end
- function Count(Table)
- local Count = 0;
- for i,v in next, Table do
- Count = Count+1
- end
- return Count;
- end
- function Check(PFolder,Requirments)
- local Count = 0;
- for i,v in next, Requirments do
- if tonumber(PFolder[i]) ~= nil and PFolder[i] and tonumber(PFolder[i]) >= tonumber(v) then
- Count = Count+1;
- elseif tostring(PFolder[i])~= nil and PFolder[i] and tostring(PFolder[i]) == tostring(v) then
- Count = Count+1;
- end
- end
- return Count;
- end
- --[[Button must be the button instance not the click detector,
- Requirements must be the dictionary of Requirements
- Stat is the Stat to be indexed if they meet the requirement
- Value is what the stats value should be set to if they meet the requirement
- --]]
- function CreateClick(Button,Requirements,Stat,Value)
- local Original = Button.Name;
- local Debounce = false;
- Button.Head.ClickDetector.MouseClick:connect(function(PLAYER)
- if Debounce then
- return
- end
- local PFolder = game:GetService("ServerStorage").PlayerFolders:WaitForChild(tostring(PLAYER))
- local PFolderDict = CreateDict(PFolder:GetChildren());
- if Count(Requirements) ~= Check(PFolderDict,Requirements) then
- Button.Name = "Improper requirements";
- Debounce = true;
- wait(2);
- Debounce = false;
- Button.Name = Original;
- elseif Count(Requirements) == Check(PFolderDict,Requirements) then
- Debounce = true;
- if Requirements["Gold"] then
- PFolder.Gold.Value = PFolder.Gold.Value - Requirements["Gold"];
- end
- if Requirements["Bounty"] then
- PFolder.Bounty.Value = PFolder.Bounty.Value - (Requirements["Bounty"]/2);
- end
- PFolder[Stat].Value = Value;
- Button.Name = "Success!"
- wait(2);
- Debounce = false;
- Button.Name = Original;
- end
- end)
- end
- --End of CreateClick function
- --Whatever is here has been compressed to my best of abilities.
- shops={}doctors={}skills={}levels={}local a={}function find(b)for c,d in pairs(b:GetChildren())do if d.Name=="ShopData"and d.Parent:findFirstChild("BasicShop",true)then shops[#shops+1]=d.Parent elseif d.Name=="Visit Doctor"then doctors[#doctors+1]=d.Head elseif d.Name=="ShopData"and d.Parent:findFirstChild("SkillShop",true)then skills[#skills+1]=d.Parent elseif d.Name=="ShopData"and d.Parent:findFirstChild("LevelShop",true)then levels[#levels+1]=d.Parent elseif d.Name=="ShopData"and d.Parent:findFirstChild("Trade",true)then a[#a+1]=d.Parent elseif d:IsA("BasePart")and d.Name=="Head"then find(d)elseif d:IsA("Model")then find(d)end end end;find(game.Workspace)function setupshop(e)local f=true;if e.ShopData:findFirstChild("MarineOnly")then e.BrickColor=BrickColor.new("Bright blue")else e.BrickColor=BrickColor.new("Bright green")end;e.ShopData.Cost.Value=math.floor(e.ShopData.Cost.Value*(math.random(1,2)+math.random()))e.Parent.Name=""..e.ShopData.Item.Value.." $"..e.ShopData.Cost.Value..""e.ClickDetector.MouseClick:connect(function(g)if g~=nil then if not f then return end;f=false;e.BrickColor=BrickColor.new("Bright red")local h=game.ServerStorage.PlayerFolders:WaitForChild(g.Name)if e:findFirstChild(h.Race.Value,true)then e.Parent.Name="Not allowed for "..h.Race.Value.."s"wait(1)e.Parent.Name=""..e.ShopData.Item.Value.." $"..e.ShopData.Cost.Value..""if e.ShopData:findFirstChild("MarineOnly")then e.BrickColor=BrickColor.new("Bright blue")else e.BrickColor=BrickColor.new("Bright green")end;f=true;return end;if h then local i=true;local j=nil;local skills=nil;local k=true;skills=game:GetService("HttpService"):JSONDecode(h.Skills.Value)if e.ShopData:findFirstChild("Req")then skills=game:GetService("HttpService"):JSONDecode(h.Skills.Value)j=game:GetService("HttpService"):JSONDecode(e.ShopData.Req.Value)for c,d in pairs(j)do if skills[c]and skills[c]>=d then else i=false;k=false end end end;if e.ShopData:findFirstChild("OneType")then for c,d in pairs(g.Backpack:GetChildren())do if d:findFirstChild("Type")and d.Type.Value==e.ShopData.OneType.Value then i=false end end;if g.Character:findFirstChild("Type",true)and g.Character:findFirstChild("Type",true).Value==e.ShopData.OneType.Value then i=false end;if skills["Arsenal"]and not g.Backpack:FindFirstChild(e.ShopData.Item.Value)and not g.Character:FindFirstChild(e.ShopData.Item.Value)then i=true end end;if e.ShopData:findFirstChild("MarineOnly")and h.Class.Value~="Marine"then i=false end;if e.ShopData:findFirstChild("RebelOnly")and h.Class.Value~="Revolutionary"then i=false end;if h.Gold.Value>=e.ShopData.Cost.Value and i then local l=g.Character:FindFirstChild("Rings")if l and l:FindFirstChild("Bargain Ring")and math.random(1,2)==1 then h.Gold.Value=h.Gold.Value-e.ShopData.Cost.Value/2 else h.Gold.Value=h.Gold.Value-e.ShopData.Cost.Value end;e.Parent.Name="Bought "..e.ShopData.Item.Value..""if game.ServerStorage.Tools:FindFirstChild(e.ShopData.Item.Value,true)then game.ServerStorage.Tools:FindFirstChild(e.ShopData.Item.Value,true):clone().Parent=g.Backpack end elseif i==false then if k==false then e.Parent.Name="Skill in this field isnt high enough!"wait(0.3)elseif e.ShopData:findFirstChild("MarineOnly")and h.Class.Value~="Marine"then e.Parent.Name="Marines only!"wait(0.3)elseif e.ShopData:findFirstChild("RebelOnly")and h.Class.Value~="Revolutionary"then e.Parent.Name="Revolutionaries only!"wait(0.3)else e.Parent.Name="You can only have one!"wait(0.3)end else e.Parent.Name="Can't afford "..e.ShopData.Item.Value.."!"wait(0.3)end end;wait(0.3)e.Parent.Name=""..e.ShopData.Item.Value.." $"..e.ShopData.Cost.Value..""if e.ShopData:findFirstChild("MarineOnly")then e.BrickColor=BrickColor.new("Bright blue")else e.BrickColor=BrickColor.new("Bright green")end;f=true end end)end;prices={["Cut"]=500,["Bruise"]=600,["Puncture"]=700,["Cold"]=700,["Infection"]=1100,["Cough"]=1700,["Large Cut"]=2500,["Scurvy"]=5000,["Malnutrition"]=6000}function setupdoc(e)local m=e.Parent;local f=true;m.Name="Visit Doctor"e.ClickDetector.MouseClick:connect(function(g)if g~=nil then if not f then return end;f=false;local h=game.ServerStorage.PlayerFolders:WaitForChild(g.Name)if h then local n=0;e.BrickColor=BrickColor.new("Bright red")local o=game:GetService("HttpService"):JSONDecode(h.HealthConditions.Value)for c,d in pairs(o)do if prices[d]and h.Gold.Value>=prices[d]then h.Gold.Value=h.Gold.Value-prices[d]table.remove(o,c)elseif prices[d]then n=n+prices[d]else end end;if n~=0 then m.Name="You still need $"..n end;h.HealthConditions.Value=game:GetService("HttpService"):JSONEncode(o)wait(1)m.Name="Visit Doctor"e.BrickColor=BrickColor.new("Bright green")f=true end end end)end;function setuptrade(e)local m=e.Parent;local f=true;m.Name=e.ShopData.Item.Value.." : "..e.ShopData.Trade.Value.." (x"..e.ShopData.Amount.Value..") "e.ClickDetector.MouseClick:connect(function(g)if g~=nil then if not f then return end;f=false;local h=game.ServerStorage.PlayerFolders:WaitForChild(g.Name)if h then local p=0;for c,d in pairs(g.Backpack:GetChildren())do if d.Name==e.ShopData.Trade.Value then p=p+1 end end;if p>=e.ShopData.Amount.Value then for q=1,e.ShopData.Amount.Value do if g.Backpack:findFirstChild(e.ShopData.Trade.Value)then g.Backpack:findFirstChild(e.ShopData.Trade.Value):Destroy()end end;local r=game.ServerStorage.Tools:FindFirstChild(e.ShopData.Item.Value,true):clone()r.Parent=g.Backpack end end;wait(0.5)f=true end end)end;function commaValue(s)local t=s;local u;repeat t,u=string.gsub(t,"^(-?%d+)(%d%d%d)",'%1,%2')until u==0;return t end;function setupskill(e)local f=true;e.BrickColor=BrickColor.new("Bright yellow")e.Parent.Name=""..e.ShopData.Item.Value.." $"..commaValue(e.ShopData.Cost.Value)..", "..commaValue(e.ShopData.CostB.Value*10).."B"e.ClickDetector.MouseClick:connect(function(g)if g~=nil then if not f then return end;f=false;e.BrickColor=BrickColor.new("Bright yellow")local h=game.ServerStorage.PlayerFolders:WaitForChild(g.Name)if h then if e:findFirstChild(h.Race.Value,true)then e.Parent.Name="Not allowed for "..h.Race.Value.."s"wait(1)f=true;return end;local i=true;local v=true;local w=true;local skills=game:GetService("HttpService"):JSONDecode(h.Skills.Value)local j=game:GetService("HttpService"):JSONDecode(e.ShopData.Req.Value)for c,d in pairs(j)do if skills[c]and skills[c]>=d or skills[c]==nil and d==0 then if c=="Mirage"and skills["Cannon"]or c=="Cannon"and skills["Mirage"]or c=="Impact"and skills["Barrage"]or c=="Barrage"and skills["Impact"]or c=="1sProjectile"and skills["1sParry"]or c=="1sParry"and skills["1sProjectile"]or c=="Yeet"and skills["Heavy"]or c=="Heavy"and skills["Yeet"]or c=="Reload"and skills["CannonMaster"]or c=="CannonMaster"and skills["Reload"]or c=="Spin"and skills["Pound"]or c=="Pound"and skills["Spin"]or c=="SamuraiAOE"and skills["Slice"]or c=="Slice"and skills["SamuraiAOE"]or c=="Slashes"and not skills["Cannon"]or c=="DragonsBreath"and not skills["Barrage"]or c=="SamuraiAOE"and not skills["SamuraiCounter"]or c=="WaterDash"and not skills["Wavey"]or c=="Wavey"and not skills["WaterDash"]or c=="Blocker"and not skills["Reload"]or c=="Arsenal"and not skills["CannonMaster"]then w=false end else i=false end end;if j["Rokushiki"]and h.Race.Value~="Human"or j["Fishman Karate"]and h.Race.Value~="Fishman"or j["Dwarf"]and h.Race.Value~="Dwarf"then v=false end;if h.Race.Value=="Human"then w=true end;if h.Gold.Value>=e.ShopData.Cost.Value and h.Bounty.Value>=e.ShopData.CostB.Value and i and v and w then if h.SkillsLeft.Value==0 then f=true;return end;if h.Race.Value=="Giant"then return end;h.SkillsLeft.Value=h.SkillsLeft.Value-1;e.Parent.Name="Learned "..e.ShopData.Item.Value..""h.EXP.Value=h.EXP.Value+500;for c,d in pairs(j)do if skills[c]and skills[c]==d then skills[c]=d+1 elseif not skills[c]then skills[c]=1 end end;h.Skills.Value=game:GetService("HttpService"):JSONEncode(skills)h.Bounty.Value=h.Bounty.Value-e.ShopData.CostB.Value/2;h.Gold.Value=h.Gold.Value-e.ShopData.Cost.Value elseif i==false then e.Parent.Name="Skill in this field isnt high enough!"elseif not v then e.Parent.Name=h.Race.Value.."'s cannot obtain this skill!"elseif w==false then e.Parent.Name="You can only go one path!"elseif h.Gold.Value<e.ShopData.Cost.Value then e.Parent.Name="Can't afford "..e.ShopData.Item.Value.."!"elseif h.Bounty.Value<e.ShopData.CostB.Value then e.Parent.Name="Need more bounty!"end end;wait(2)e.Parent.Name=""..e.ShopData.Item.Value.." $"..commaValue(e.ShopData.Cost.Value)..", "..commaValue(e.ShopData.CostB.Value*10).."B"e.BrickColor=BrickColor.new("Bright yellow")f=true end end)end;skillys={["Soru"]=true,["Geppo"]=true}function setupslevl(e)local f=true;e.BrickColor=BrickColor.new("Hot pink")e.Parent.Name=e.ShopData.Item.Value.."| 35k Bounty"e.ClickDetector.MouseClick:connect(function(g)if g~=nil then if not f then return end;f=false;e.BrickColor=BrickColor.new("Hot pink")local h=game.ServerStorage.PlayerFolders:WaitForChild(g.Name)if h then local i=true;local skills=game:GetService("HttpService"):JSONDecode(h.Skills.Value)local j=game:GetService("HttpService"):JSONDecode(e.ShopData.Req.Value)for c,d in pairs(skills)do if skillys[c]and(not skills["Rokushiki"]or skills["Rokushiki"]~=4)then i=false end end;if h.LVL.Value>=e.ShopData.LevelShop.Value and i and h.Bounty.Value>=3500 then if h.Race.Value=="Giant"then return end;e.Parent.Name="Learned "..e.ShopData.Item.Value..""for c,d in pairs(j)do if skills[c]and skills[c]==d then skills[c]=d+1 elseif not skills[c]then skills[c]=1 end end;h.Skills.Value=game:GetService("HttpService"):JSONEncode(skills)elseif i==false then e.Parent.Name="Only 1 purple skill allowed!"elseif h.Bounty.Value<3500 then e.Parent.Name="Not enough bounty!"elseif h.LVL.Value<e.ShopData.LevelShop.Value then e.Parent.Name="Level not high enough!"end end;wait(2)e.BrickColor=BrickColor.new("Hot pink")e.Parent.Name=e.ShopData.Item.Value.."| 35k Bounty"f=true end end)end;for c,d in pairs(shops)do setupshop(d)end;for c,d in pairs(a)do setuptrade(d)end;for c,d in pairs(doctors)do setupdoc(d)end;for c,d in pairs(skills)do setupskill(d)end;for c,d in pairs(levels)do setupslevl(d)end;local x=false;RebirthPart=workspace:WaitForChild("Rebirth")workspace.Rebirth.Head.ClickDetector.MouseClick:Connect(function(y)local h=game.ServerStorage.PlayerFolders:WaitForChild(y.Name)local z=game:GetService("HttpService"):JSONDecode(h.Skills.Value)if h.Bounty.Value>=5000 and h.LVL.Value>=15 and not x and h.Rebirth.Value<5 then x=true;local A=false;for c,d in pairs(z)do print(d)if d>=3 then A=true end end;if A==true then h.Bounty.Value=0;h.Skills.Value="[]"h.Gold.Value=5000;h.GiantCutlass.Value=false;h.DwarfUpgrade.Value=false;h.DwarfUpgrade2.Value=false;h.DwarfUpgrade3.Value=false;h.SkypieanUpgrade.Value=false;h.SkypieanUpgrade2.Value=false;h.SkypeianUpgrade3.Value=false;h.CyborgUpgrade3.Value=false;h.CyborgUpgrade2.Value=false;h.CyborgUpgrade.Value=false;h.FishmanUpgrade.Value=false;h.GiantUpgrade.Value=false;h.GiantUpgrade2.Value=false;h.GiantCutlass2.Value=false;h.MinkUpgradee.Value=false;h.Buso3.Value=false;h.Ken3.Value=false;h.Muscle.Value=0;h.Fat.Value=0;h.LVL.Value=1;h.EXP.Value=0;h.BankGold.Value=10000;h.Stomach.Value=h.Stomach.MaxValue;h.HealthConditions.Value="[]"h.Rebirth.Value=h.Rebirth.Value+1;h.SkillsLeft.Value=5+h.Rebirth.Value;if math.random(1,50/h.Rebirth.Value)==1 then h.HaoBorn.Value=true end;y:LoadCharacter()RebirthPart.Name="REBORNNNNNNNNNNNNNNNNNNNN!"wait(2)RebirthPart.Name="Rebirth"x=false else RebirthPart.Name="..."wait(2)x=false;RebirthPart.Name="Rebirth"end elseif not x then RebirthPart.Name="..."wait(2)x=false;RebirthPart.Name="Rebirth"end end)
- --End of that....
- --Cyborg Race Upgrades
- local CyborgReq1 = {["Gold"] = 10000,["LVL"] = 5,["Race"] = "Cyborg",["CyborgUpgrade"] = false}
- local CyborgReq2 = {["Gold"] = 20000,["LVL"] = 10,["Race"] = "Cyborg",["CyborgUpgrade"] = true,["CyborgUpgrade2"] = false}
- local CyborgReq3 = {["Gold"] = 40000,["LVL"] = 15,["Race"] = "Cyborg",["CyborgUpgrade"] = true,["CyborgUpgrade2"] = true,["CyborgUpgrade3"] = false}
- CreateClick(workspace["Cyborg Upgrade [10k Beli] [Level 5]"],CyborgReq1,"CyborgUpgrade",true)
- CreateClick(workspace["Cyborg Upgrade2 [20k Beli] [Level 10]"],CyborgReq2,"CyborgUpgrade2",true)
- CreateClick(workspace["Cyborg Upgrade3 [40k Beli] [Level 15]"],CyborgReq3,"CyborgUpgrade3",true)
- --Fishmen Race Upgrades
- local FishmanReq1 = {["Gold"] = 30000,["LVL"] = 5,["Race"] = "Fishman",["FishmanUpgrade"] = false}
- local FishmanReq2 = {["Gold"] = 30000,["LVL"] = 10,["Race"] = "Fishman",["FishmanUpgrade"] = true,["FishmanUpgrade2"] = false}
- CreateClick(workspace["Fishman Upgrade [30k Beli] [Level 5]"],FishmanReq1,"FishmanUpgrade",true)
- CreateClick(workspace["Fishman Upgrade 2 [30k Beli] [Level 10]"],FishmanReq2,"FishmanUpgrade2",true)
- --Giant Race Upgrades
- local GiantReq1 = {["Gold"] = 30000,["LVL"] = 5,["Race"] = "Giant",["GiantUpgrade"] = false}
- local GiantReq2 = {["Gold"] = 40000,["LVL"] = 10,["Race"] = "Giant",["GiantUpgrade"] = true,["GiantUpgrade2"] = false}
- local GiantReq3 = {["Gold"] = 60000,["LVL"] = 15,["Race"] = "Giant",["GiantUpgrade"] = true,["GiantUpgrade2"] = true,["GiantUpgrade3"] = false}
- CreateClick(workspace["Giant Upgrade [30k Beli] [Level 5]"],GiantReq1,"GiantUpgrade",true)
- CreateClick(workspace["Giant Upgrade2 [40k Beli] [Level 10]"],GiantReq2,"GiantUpgrade2",true)
- CreateClick(workspace["Giant Upgrade3 [60k Beli] [Level 15]"],GiantReq3,"GiantUpgrade3",true)
- --Giant Sword Upgrades
- local GiantSwordReq1 = {["Gold"] = 20000,["Bounty"] = 1500,["Race"] = "Giant",["GiantCutlass"] = false}
- local GiantSwordReq2 = {["Gold"] = 40000,["Bounty"] = 3000,["Race"] = "Giant",["GiantCutlass"] = true,["GiantCutlass2"] = false}
- CreateClick(workspace["Giant Sword Upgrade [20k Beli] [15k Bounty]"],GiantSwordReq1,"GiantCutlass",true)
- CreateClick(workspace["Giant Sword Upgrade2 [40k Beli] [30k Bounty]"],GiantSwordReq2,"GiantCutlass2",true)
- --Dwarf Race Upgrades
- local DwarfReq1 = {["Gold"] = 20000,["LVL"] = 5,["Race"] = "Dwarf",["DwarfUpgrade"] = false}
- local DwarfReq2 = {["Gold"] = 40000,["LVL"] = 10,["Race"] = "Dwarf",["DwarfUpgrade"] = true,["DwarfUpgrade2"] = false}
- local DwarfReq3 = {["Gold"] = 60000,["LVL"] = 15,["Race"] = "Dwarf",["DwarfUpgrade"] = true,["DwarfUpgrade2"] = true,["DwarfUpgrade3"] = false}
- CreateClick(workspace["Dwarf Upgrade [20k Beli] [Level 5]"],DwarfReq1,"DwarfUpgrade",true)
- CreateClick(workspace["Dwarf Upgrade2 [40k Beli] [Level 10]"],DwarfReq2,"DwarfUpgrade2",true)
- CreateClick(workspace["Dwarf Upgrade3 [60k Beli] [Level 15]"],DwarfReq3,"DwarfUpgrade3",true)
- --Mink Race Upgrades
- local MinkReq1 = {["Gold"] = 35000,["LVL"] = 15,["Race"] = "Mink",["MinkUpgradee"] = false}
- local MinkReq2 = {["Gold"] = 60000,["LVL"] = 25,["Race"] = "Mink",["MinkUpgradee"] = true,["MinkUpgradee2"] = false}
- CreateClick(workspace["Mink Upgrade [35k Beli] [Level 15]"],MinkReq1,"MinkUpgradee",true)
- CreateClick(workspace["Mink Upgrade 2 [60k Beli] [Level 25]"],MinkReq2,"MinkUpgradee2",true)
- --Skypiean Race Upgrades
- local SkypieanReq1 = {["Gold"] = 20000,["LVL"] = 5,["Race"] = "Skypiean",["SkypieanUpgrade"] = false}
- local SkypieanReq2 = {["Gold"] = 30000,["LVL"] = 10,["Race"] = "Skypiean",["SkypieanUpgrade"] = true,["SkypieanUpgrade2"] = false}
- local SkypieanReq3 = {["Gold"] = 60000,["LVL"] = 15,["Race"] = "Skypiean",["SkypieanUpgrade"] = true,["SkypieanUpgrade2"] = true,["SkypieanUpgrade3"] = false}
- CreateClick(workspace["Skypiean Upgrade [20k Beli] [Level 5]"],SkypieanReq1,"SkypieanUpgrade",true)
- CreateClick(workspace["Skypiean Upgrade2 [30k Beli] [Level 10]"],SkypieanReq2,"SkypieanUpgrade2",true)
- CreateClick(workspace["Skypiean Upgrade3 [60k Beli] [Level 15]"],SkypieanReq3,"SkypieanUpgrade3",true)
Add Comment
Please, Sign In to add comment