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

My script for my double money gamepass isn't working with an else / if statement?

Asked by
zomspi 541 Moderation Voter
5 years ago

My script for a double money gamepass isn't working, it is meant to be if they own the gamepass they get 4 money on kill and if they do not own the gamepass they get 2 money on kill, that isn't the case though?

    game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(character)
    if game.MarketplaceService:PlayerOwnsAsset(player,7187215) then

     game.Players.PlayerAdded:connect(function(p) 
     p.CharacterAdded:connect(function(c)

      c.Humanoid.Died:connect(function() 



    local cv = c.Humanoid:findFirstChild("creator") 

           if cv

             then 

              local k = cv.Value 


            if k and k ~= p then 

              endk.leaderstats.Money.Value = k.leaderstats.Monaey.Value+4


                                        else

                     game.Players.PlayerAdded:connect(function(p) 

                       p.CharacterAdded:connect(function(c)

                      c.Humanoid.Died:connect(function() 

                     local cv = c.Humanoid:findFirstChild("creator") 
                        if cv

                             then 

                                   local k = cv.Value 
                                      if k and k ~= p then 

                                      endk.leaderstats.Money.Value = k.leaderstats.Money.Value+4

                                             end  -- end k and k ~= p
                                             end -- end if cv

                                           end) -- c.Humanoid.Died:connect
                                           end) -- p.CharacterAdded:connect
                                         end) -- game.Players.PlayerAdded:connect(function(p)

                             end -- end if k and k ~= p then 
         end -- end if cv

            end) -- end the died:connect (again???)
            end) -- p.CharacterAdded:connect(function(c) (again???)
            end) --  game.Players.PlayerAdded:connect (again)???

    end --   if game.MarketplaceService:PlayerOwnsAsset(player,7187215) 





    end) --  player.CharacterAdded:Connect(function(character)
    end) -- game.Players.PlayerAdded:Connect(function(player)


p.s the green writing is because someone helped me with it. Thanks!

0
u have endk at line 23 EmbeddedHorror 299 — 5y
0
That didn't work, deleting that. I also made a mistake, in the 42nd line Money.Value+4 is meant to be Money.Value+2 zomspi 541 — 5y

Answer this question