#help me im confused

19 messages · Page 1 of 1 (latest)

glossy sage
#

so i was watching a video how to make a hit box and the script was this
game.ReplicatedStorage.CombatHit.OnServerEvent:Connect(function(plr)
print(plr)

local hitbox = Instance.new("Part")
local rootPart = plr.Character.HumanoidRootPart
hitbox.Parent = workspace
hitbox.Anchored = true
hitbox.CanCollide = false

hitbox.Transparency = 0
hitbox.Size = Vector3.new(10,10,10)
hitbox.CFrame = plr.Character.rootpart.Cframe * CFrame.new(0,2,-5)
game.Debris:AddItem(hitbox,1)
end)

the game.Debris:AddItem(hitbox,1) is supposed to make the hitbox disappear and the hitbox.CFrame = plr.Character.rootpart.Cframe * CFrame.new(0,2,-5) is supposed to spawn the ("part") at the humanoidrootpart at (0,2,-5)

upper mortar
#
game.ReplicatedStorage.CombatHit.OnServerEvent:Connect(function(plr)
    print(plr)



    local hitbox = Instance.new("Part")
    local rootPart = plr.Character.HumanoidRootPart
    hitbox.Parent = workspace
    hitbox.Anchored = true
    hitbox.CanCollide = false

hitbox.Transparency = 0
hitbox.Size = Vector3.new(10,10,10)
hitbox.CFrame = plr.Character.rootpart.Cframe * CFrame.new(0,2,-5)
game.Debris:AddItem(hitbox,1)
end)
#

hm

#

how you got player

#

where end of the function

glossy sage
#

Oh...

upper mortar
#

?

#

@glossy sage

#

do you find problen?

#

problem*

upper mortar
#
game.Players.PlayerAdded:Connect(function(plr)
    game.ReplicatedStorage.CombatHit.OnServerEvent:Connect(function()
        print(plr)



        local hitbox = Instance.new("Part")
        local rootPart = plr.Character.HumanoidRootPart
        hitbox.Parent = workspace
        hitbox.Anchored = true
        hitbox.CanCollide = false
        hitbox.Transparency = 0
        hitbox.Size = Vector3.new(10,10,10)
        hitbox.CFrame = plr.Character.rootpart.Cframe * CFrame.new(0,2,-5)
        game.Debris:AddItem(hitbox,1)
    end)
end)


glossy sage
#

No I haven't found the problem

upper mortar
#

it print plr name?

glossy sage
#

no it didnt

upper mortar
#

Then you cant find plr

#

Delete function(plr)

#

Try this