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

Why doesn't this work in a real server?

Asked by 10 years ago

This here code piece doesn't work in a real server, and it's in a localscript. I've tried changing the code up a little bit but it still wouldn't work, Here it is:

local damagemultiplier = 1

    local passes = {{"Peeta's Perks", 146508254}}
    for _, pass in pairs(passes) do
        if Game:GetService("GamePassService"):PlayerHasPass(Game.Players.LocalPlayer, pass[2]) then
            local m = Instance.new("Message", Tool.Parent)
            m.Text = "You have the " .. pass[1] .. " gamepass!"
            if pass[1] == "Peeta's Perks" then
                damagemultiplier = damagemultiplier + (Game.Players.LocalPlayer.District.Value == 12 and 0.46 or 0.23)
            end
        end 
    end
    damage = maindamage * damagemultiplier

2 answers

Log in to vote
0
Answered by 10 years ago

Try putting a wait() at the start of it. I'm not sure if they fixed it yet or not, but it can start early sometimes.

0
Still didn't work.. 1GREENBOB123456 15 — 10y
0
Okay, was just saying it could POSSIBLY be that. PiggyJingles 358 — 10y
Ad
Log in to vote
0
Answered by 10 years ago

If we take a look at the documentation, we can see that the PlayerHasPass method does not work in LocalScripts.

Answer this question