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

Struggling to get Power to go up in SB fan game?

Asked by 2 years ago

I'm making an SB fan game and I need help with my IntValue going up Im making a killstreak glove so basically I want it to Gain 1 power every kill. There are multiple scripts that have aspects of this so it might take a while to find the issue, If you are actually taking time out of your day to help me out you deserve so the best life ever. I don't expect it to be anythng complicated probably just a typo. Thanks for your help:

Script one: Located in PlayerHit (IntValue) which is located in ServerStorage

01local TimeToDeath = 60
02local pir = script.Parent.Parent
03local humanoid = pir:FindFirstChild("Humanoid")
04local ePIr = script.Parent.Value
05while wait(0.1) do
06    TimeToDeath = TimeToDeath - 0.1
07    if humanoid then
08        if TimeToDeath > 0 then
09            humanoid.Died:Connect(function)
10            for i,v in pairs(game. Workspace:GetChildren()) do
11                if v:lsA("Model") then
12                    if v and v.Name == ePIr then
13                        if game.Players:GetPlayerFromCharacter(v).Backpack:FindFirstChild("Killstreak")then
14                            game.Players:GetPlayerFromCharacter(v).Backpack.Killstreak.Handle.HitHandler.Power.Value+=1
15                            script.Parent:Destroy()
View all 27 lines...

Script 2 located in the Handle of the killstreak Tool, has a child which is called Power and it is an IntValue

01if hit.Parent:FindFirstChild("Humanoid") then
02        local eChar = hit.Parent
03        local plrChar = Tool.Parent
04 
05        local eHumanRootPart = eChar:FindFirstChild("HumanoidRootPart")
06        local plrHumanRootPart = plrChar:FindFirstChild("HumanoidRootPart")
07 
08        if plrHumanRootPart and eHumanRootPart then
09            script.Disabled = true
10            eChar.Humanoid.Sit = true
11 
12            local force = Instance.new("BodyVelocity", eHumanRootPart)
13            force.MaxForce = Vector3.new(2,2,2) * math.huge
14            local direction = (eHumanRootPart.CFrame.Position - plrHumanRootPart.CFrame.Position).Unit
15            force.Velocity = (direction + Vector3.new(0,1,0)).Unit * Power.Value
View all 50 lines...

1 answer

Log in to vote
0
Answered by 2 years ago

On line 10 of the first script you have a space where game. Workspace it should be like this game.Workspace I don't know if this will cause your script not to work but that I might be the fix. Also are there any errors?? Hope this helps!!

Ad

Answer this question