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

My InputBegan Gamepass script is not working, how can I solve this?

Asked by 6 years ago

Hi, I am Goobye and I am trying to put gamepass in this input began ie if the player has that gamepass it releases this function from user input began

This is my script :

local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local uis = game:GetService("UserInputService") 
local passId = 1622040008

uis.InputBegan:Connect(function(key)
    if game.GamePassService:PlayerHasPass(player ,passId) then return end
    if key.KeyCode == Enum.KeyCode.V then
        wait(1)
        game.ReplicatedStorage.WingsofFreedom:Clone().Parent = char
        local fr = Instance.new("Fire", char.UpperTorso)
        fr.Heat = 20
        fr.Size = 10
        fr.Color = Color3.new(102,0,0)
        char.Humanoid.MaxHealth = 500
        char.Humanoid.Health = 500
    end
end)

If needed this is the button script to buy this gamepass

local Player = game.Players.LocalPlayer

script.Parent.MouseButton1Click:connect(function()
 game.MarketplaceService:PromptPurchase(Player, 1622040008)
end)
0
You're returning if the player does have the gamepass. So if the player has it, that means the function won't run. Is that what you want? NotInventedHere 158 — 6y
0
sim Goodbye_Fx 29 — 6y
0
yes man Goodbye_Fx 29 — 6y

Answer this question