Whats wrong with the script?

What’s wrong with my script? please help!

local player = game:GetService("Players").LocalPlayer 							 -- Gets you the Player
local mouse,texture = player:GetMouse(),"rbxassetid://316335774"--68308747 --Gets mouse and texture
function mouseIcon(p,m,t) 					-- begins the function
if ( p ~= nil and m ~= nil and t) then -- checks the reactants
m.Icon = t end end 							-- makes the icon what you want/ends function
mouseIcon(player,mouse,texture) 			-- activates the function



Settings = {
false,--PlayerList
false,--Health
false,--Backpack
false}--Chat

for _,i in pairs(Settings) do
   game.StarterGui:SetCoreGuiEnabled (_-1,i)
end
script.Disabled = true

Your error is occurring at the bottom of the script in your loop, which seems to be looping through a table but you’re not actually telling the StarterGui what element to disable.

Instead, you can adapt your code as in the example below which should work properly. Remember that it’s also good practice to indent your code and format it neatly to make it easier for yourself and other programmers to read.

---> variables
local player = game:GetService("Players").LocalPlayer
local mouse = player:GetMouse()
local texture = "rbxassetid://316335774"

-- mouse icon function
function mouseIcon(p,m,t)
    if (p ~= nil and m ~= nil and t ~= nil) then
        m.Icon = t
    end
end

-- set core gui enabled function
function setCore(settings)
    for setting,value in pairs(settings) do
        game:GetService("StarterGui"):SetCoreGuiEnabled(setting,value)
    end
end

-- define the gui settings that we want to use
--[[ 
    this allows us to reference to each individual item that we want 
    to change, and we can also change the values to true/false when we 
    use a function 
]]--

local guiSettings = {
    ["PlayerList"] = false,
    ["Health"] = false,
    ["Backpack"] = false,
    ["Chat"] = false
}

---> main (call functions)
mouseIcon(player,mouse,texture)
setCore(guiSettings)

Hello! I made double jump in my game and made animation, also the game and animation is R15.

I added this script with animation inside parented to it!

The animation only play on the first jump but not for the rest!

local parachutePeople = require(game:GetService(“ReplicatedStorage”).Modules.Extra:WaitForChild(“ParachuteUsers”))
local module = {}
local UserInputService = game:GetService(“UserInputService”)

local plr
local character
local humanoid

local canDoubleJump = false
local amountOfJumps = 0
local oldPower
local TIME_BETWEEN_JUMPS = .325
local DOUBLE_JUMP_POWER_MULTIPLIER = 1.75
local d = false
local running = Enum.HumanoidStateType.Running
local landed = Enum.HumanoidStateType.Landed
local standing = Enum.HumanoidStateType.PlatformStanding

local main = script.Parent.Parent.Parent:WaitForChild(“main”)
local jumpUI = main.DoubleJumpText

local jumpAnim = script:WaitForChild(“Animation”)
local AnimL

local playersWhoHaveParachute = parachutePeople.Users

local bestJumpList = {
[1] = “Jump2”,[2] = “Jump3”,[3] = “Jump4”,[4] = “Jump5”,[5] = “Jump6”,
[6] = “Jump7”,[7] = “Jump8”,[8] = “Jump9”,[9] = “Jump10”,
}

local maxJumpAmount = nil
local setMaxDoubleJumps = function()
local jumpChoosen = nil
for i = #bestJumpList, 1, -1 do
local jumpName = bestJumpList[i]
if jumpName ~= nil then
local val = plr:WaitForChild(“Skills”):FindFirstChild(tostring(jumpName))
if val ~= nil then
jumpChoosen = i break
end
end
end

if jumpChoosen ~= nil then
	maxJumpAmount = (tonumber(jumpChoosen)+1)
else
	maxJumpAmount = 1
end

end

local getMaxDoubleJumps = function()
if maxJumpAmount ~= nil then
return tonumber(maxJumpAmount)
end
end

local setDoubleJumpUI = function()
local maxJumps = getMaxDoubleJumps()
jumpUI.Text = “Double Jumps: “…tostring(amountOfJumps)…”/”…tostring(maxJumps)
jumpUI.Visible = true
if amountOfJumps >= maxJumps then
jumpUI.TextColor3 = Color3.fromRGB(191, 21, 6)
jumpUI.TextTransparency = .4
end
end

function onJumpRequest()
if not character or not humanoid or not character:IsDescendantOf(workspace) or
humanoid:GetState() == Enum.HumanoidStateType.Dead then
return
end

if d == false then 
	local maxJumps = getMaxDoubleJumps()
	if canDoubleJump == true and amountOfJumps < maxJumps then
		d = true
		humanoid.JumpPower = oldPower * DOUBLE_JUMP_POWER_MULTIPLIER
		humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
		amountOfJumps = amountOfJumps + 1
		AnimL:Play()
		canDoubleJump = false
		setDoubleJumpUI() wait() 
		d = false
	end
end

end

local function characterAdded(newCharacter)
if playersWhoHaveParachute[plr.Name] == true then
else
character = newCharacter
humanoid = newCharacter:WaitForChild(“Humanoid”)
canDoubleJump = false
oldPower = humanoid.JumpPower

	AnimL = humanoid:LoadAnimation(jumpAnim)
	
	setMaxDoubleJumps()
	
	humanoid.StateChanged:Connect(function(old, new)
		if new == landed or new == standing or new == running then
			if canDoubleJump == true then
				canDoubleJump = false
				jumpUI.Visible = false
				jumpUI.TextColor3 = Color3.fromRGB(255, 255, 255)
				jumpUI.TextTransparency = 0
				humanoid.JumpPower = oldPower
				amountOfJumps = 0
			end
		elseif new == Enum.HumanoidStateType.Freefall then
			if amountOfJumps <= 0 then
				wait(.2)
				canDoubleJump = true
			else
				wait(TIME_BETWEEN_JUMPS)
				canDoubleJump = true
			end
		end
	end)
end

end

function module:Int(localPlayer)
plr = localPlayer

if plr.Character then
	characterAdded(plr.Character)
end

plr.CharacterAdded:Connect(characterAdded)
plr:WaitForChild("Skills").ChildAdded:Connect(setMaxDoubleJumps)
plr:WaitForChild("Skills").ChildRemoved:Connect(setMaxDoubleJumps)
UserInputService.JumpRequest:Connect(onJumpRequest)

end

return module