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

Equipped Function not working?

Asked by 5 years ago
Edited 5 years ago

I was making a kamehameha tool but I it doesn't print Equipped

tool.Equipped:Connect(function()
    Equipped = true
    print(Equipped)
    m.Icon = 'rbxgameasset://Images/'..'Gun Aim'
end)

If you know why then tell me.

You asked for it, the whole script

function startkame()
    if debounce == false and Equippe then
        if toggle == false then
            print ('Passed')
            debounce = true
            toggle = true
            hax = true
            print('Will it play?')
            chargetrack:Play()
            print('PLAYED')
            startkame = Instance.new("Part")
            print("made")
            startkame.Shape = 'Ball'
            print('ball')
            startkame.Material = 'Neon'
            print('mat')
            startkame.Name = 'StartKame'
            print('Name')
            startkame.BrickColor = BrickColor.new("Toothpaste")
            print('color')
            startkame.CFrame = arm.CFrame
            print('CFrame')
            startkame.Size = Vector3.new(8, 8, 8)
            print('size')
            startkame.CanCollide = false
            startkame.Anchored = true
            print(ctr)
            startkame.Parent = ctr
            wait(1)
            blast()
            print('starting')
        end
    end
end

--launching
function blast()
    print('Blastoff')
    if toggle == true then
        print('toggle is true')
        toggle = false
        launch = Instance.new('Part', ctr)
        launch.Shape = 'Cylinder'
        launch.Size = Vector3.new(75, 5, 5)
        launch.CFrame = ctr.Torso.CFrame
        launch.BrickColor = BrickColor.new('Toothpaste')
        launch.Material = 'Neon'
        launch.CanCollide = false
        launch.Anchored = true
        launch.Orientation = ctr:FindFirstChild('Torso').CFrame.lookVector*3
        wait(3)
        ctr:WaitForChild('Humanoid').WalkSpeed = norm
        hum.JumpPower = norn
        startkame:Destroy()
        launch:Destroy()
        debounce = true
        hax = false 
    end
end
hax = false
tool = script.Parent
charge = Instance.new("Animation")
charge.AnimationId = "https://www.roblox.com/asset/id?=".."02561050525"
debounce = false
toggle = false
plr = script.Parent.Parent.Parent
ctr = plr.Character or plr.CharacterAdded:Wait()
m = plr:GetMouse()
hum = ctr:WaitForChild('Humanoid')
norm = hum.WalkSpeed
norn = hum.JumpPower
Equippe = false
chargetrack = ctr:WaitForChild("Humanoid"):LoadAnimation(charge)
arm = ctr:FindFirstChild('Right Arm') or ctr:FindFirstChild('RightHand')
print ('variables are fine')

tool.Equipped:Connect(function()
    Equippe = true
    print('Equipped')
    m.Icon = 'rbxgameasset://Images/'..'Gun Aim'
end)

m.Button1Down:Connect(startkame)

m.Button1Up:Connect(function()
    print('released')
    if Equippe == true then
        blast()
    end
end)
tool.Unequipped:Connect(function()
    print('Unequipped')
    m.Icon = 'rbxassetid://'..'61210994'
    Equippe = false
    if hax and toggle then
        toggle = false
        startkame()
        debounce = true
        wait(5)
        debounce = false
        hax = false
        toggle = false
    end
end)
0
I didn't put the whole script but if you need it i'll give you it HappyTimIsHim 652 — 5y

1 answer

Log in to vote
1
Answered by
Sorukan 240 Moderation Voter
5 years ago
Edited 5 years ago

It's a string so you do

print("Equipped")
0
You're just printing it wrong, the script after the equipped function should work Sorukan 240 — 5y
0
k HappyTimIsHim 652 — 5y
0
still ain't working HappyTimIsHim 652 — 5y
0
what i was going for was a print true or print false HappyTimIsHim 652 — 5y
View all comments (6 more)
0
What does the output window say? Sorukan 240 — 5y
0
Equipped isn't a variable, it's an event so you can't just set it to true or false Sorukan 240 — 5y
0
nothing just my other prints HappyTimIsHim 652 — 5y
0
oh HappyTimIsHim 652 — 5y
0
either way the Equipped function isn't working HappyTimIsHim 652 — 5y
0
Are you sure it's the equipped function that's not working or the entire script itself because from the looks of it you're using a free model which often don't work. Sorukan 240 — 5y
Ad

Answer this question