#Attempt to call a Instance value

17 messages · Page 1 of 1 (latest)

modern ingot
#

UIS.InputBegan:Connect(function(Input, GPE)
if GPE or not Equipped then
return
end
if Input.UserInputType == Enum.UserInputType.MouseButton1 and not Debounce then
Debounce = true
Charging = true
Server:InvokeServer("EnergyBall", "Charge", {})
local Charge = 0

    local BG = Instance.new("BodyGyro", Character.HumanoidRootPart)
    BG.CFrame = CFrame.new(Character.HumanoidRootPart.Position, Mouse.Hit.Position)
    BG.MaxTorque = Vector3.one * 99999
    BG.P = 3000
    BG.D = 100
    BG.Name = "Align"
    
    local BP = Instance.new("BodyPosition", Character.HumanoidRootPart)
    BP.Position = Character.HumanoidRootPart.Position
    BP.MaxForce = Vector3.one * 99999
    BP.P = 3000
    BP.D = 100
    BP.Name = "Position"
    
    Humanoid.WalkSpeed = 0
    Humanoid.JumpHeight = 0
    
    repeat
        Charge += 1
        BG.CFrame = CFrame.new(Character.HumanoidRootPart.Position, Mouse.Hit.Position)
        task.wait()
    until Charging == false or Equipped == false
    
    Humanoid.WalkSpeed = 16
    Humanoid.JumpHeight = 7.2
    
    Server:InvokeServer("EnergyBall", "Fire", {Charge = Charge, CFrame = Character.HumanoidRootPart.CFrame, EndPos = Mouse.Hit.Position})
    
    BG:Destroy()
    BP:Destroy()
    wait (COOLDOWN)
    Debounce = false
end

end)

UIS.InputEnded:Connect(function(Input, GPE)
if Equipped and Input.UserInputType == Enum.UserInputType.MouseButton1 then
Charging = false
end
end)

#

No nitro so I had to make 2 posts for full code

#

Also when I use any other word on "Fire", it gives "attempt to call a nil value"

tidal cliff
#

Can you copy and paste the error codes?

sturdy foxBOT
#

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

modern ingot
#

Here's the replicator code:

 local Remote = game.ReplicatedStorage.Server

local Effects = {}

for i, Module in pairs(script:GetChildren()) do
    Effects[Module.Name] = require(Module)
    Module:Destroy()
end

Remote.OnClientInvoke = function(Set, Effect, Data)
    Effects[Set][Effect](Data)
end
#

I can post the Remote Script if you want, but its kinda long

void bridge
#

Effects[Set][Effect] is probably an instance

modern ingot
#

So I uh...

#

What should I do, exactly ?

void bridge
#

idk

#

have it not be an instance

modern ingot
#

I change the Server:InvokeServer("EnergyBall", "Fire", "Fire" to other names, and it gave be attempt to call a nil value

void bridge
#

well you should probably only use code that you made that way you can know how it works and know how to properly set it up and change it

modern ingot
#

How will I learn more if I get stuck with what I already know ?

#

Yea well so for some reason it detects the "Fire" function on my remote script as a Instance