#nil character

23 messages · Page 1 of 1 (latest)

dusty kernel
#

so basicly i had found a problem with "nil character" I've tried to fix it myself but since im quite new to scripting i had to give up.

  19:22:26.943  cloud_3729727240.(Put Me In StarterGui Please):3: attempt to index nil with 'Character'  -  Server
  19:22:26.943  Stack Begin  -  Studio
  19:22:26.943  Script 'cloud_3729727240.(Put Me In StarterGui Please)', Line 3  -  Studio
  19:22:26.943  Stack End  -  Studio
  19:22:26.977  cloud_9624662377.head movement:4: attempt to index nil with 'Character'  -  Server
  19:22:26.977  Stack Begin  -  Studio
  19:22:26.977  Script 'cloud_9624662377.head movement', Line 4  -  Studio
  19:22:26.977  Stack End  -  Studio
  19:22:28.312  cloud_9624662377.head movement:5: attempt to index nil with 'WaitForChild'  -  Client
  19:22:28.312  Stack Begin  -  Studio
  19:22:28.312  Script 'cloud_9624662377.head movement', Line 5  -  Studio
  19:22:28.312  Stack End  -  Studio
  19:22:31.135  Infinite yield possible on 'ReplicatedStorage.Remotes:WaitForChild("Combat")'  -  Studio
  19:22:31.136  Stack Begin  -  Studio
  19:22:31.136  Script 'ServerScriptService.CombatSever', Line 4  -  Studio - CombatSever:4
  19:22:31.136  Stack End  -  Studio

if anyone could find my problem i would really appreciate it.
yes ik im a dumb dumbell

hardy wing
#

wherever you're getting character from doesn't exist

grim oasis
#

Why’d you delete it?

dusty kernel
#

``​lua
local rp = game:GetService("ReplicatedStorage")
local remotes = rp:WaitForChild("Remotes")

local combatRemote = remotes:WaitForChild("Combat")

local ss = game:GetService("ServerStorage")
local modules = ss:WaitForChild("Modules")

local TomatoHitbox = require(modules:WaitForChild("TomatoHitbox"))
local TomatoSlow = require(modules:WaitForChild("TomatoSlow"))
local HitService = require(modules:WaitForChild("HitService"))

local animations = rp:WaitForChild("Animations")
local combatAnims = animations:WaitForChild("Combat")

local Players = game:GetService("Players")

local lastPunch = {}

local MAX_COMBO = 4

Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
char:SetAttribute("Combat",0)
end)
end)

local function changeCombo(char)
local combo = char:GetAttribute("Combo")

local player = game.Players:GetPlayerFromCharacter(char)

if not lastPunch[player] then
    lastPunch[player] = os.clock
end

local passedTime = os.clock() - lastPunch[player]

if passedTime > 1.2 then
    char:SetAttribute("Combo",1)
else
    if combo < MAX_COMBO then
        char:SetAttribute("Combo", combo +1)
    else
        char:SetAttribute("Combo",1)
    end
end

lastPunch[player] = os.clock()

end

local function getAnimation(char)
local combo = char:GetAttribute("Combo")

local anims = combatAnims:GetChildren()

local currAnim = anims[combo]

return currAnim

end

local function calculateKnockback(attacker,enemy,power)
local direction = -(attacker.HumanoidRootPart.Position - enemy.HumanoidRootPart.Position).Unit

local kb = direction * power

return kb

end

``

dense muskBOT
#

studio** You are now Level 1! **studio

dusty kernel
#

plus some more

#

but

#

it wont really let me send it

#

damm

grim oasis
#

There is no such thing ‘Combat’ in the folder

dusty kernel
#

give me 2 sec

#

this you mean or?

#

(please dont judge me im new and dumb to scripting)

grim oasis
#

That isnt your script right?

#

In the remotes folder

#

There should be a remote event

#

Called ‘Combat’

#

According to the script whoever wrote it

dusty kernel
#

intereasting

#

i guess thats what you get for following a tut xd