Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

ServerScriptService.Knock:4: attempt to call a Instance value. How to fix it?

game:GetService("ReplicatedStorage").Knock.OnServerEvent:Connect(function(player, hum)
	local chr = hum.Parent
	local plr = game.Players:GetPlayerFromCharacter(chr)
    local dio = game.Workspace.DIO(chr)
	local knockevent = game.ReplicatedStorage.KnockClient
	if chr.Deflect.Value == true then
		repeat
			wait()
		until game.Lighting.TS.Value == false
		knockevent:FireClient(player)
	elseif chr.Dodge.Value == true then	
	
	elseif chr.RTZ.Value == true then
			
	elseif chr.Deflect.Value == false then
		repeat
			wait()
		until game.Lighting.TS.Value == false
		knockevent:FireClient(plr)
		knockevent:FireClient(dio)
	end
end)

Dummies cannot be damaged, only players. How to fix it?

1 answer

It is exactly what the error says it is. On line 4, you are trying to call an instance. What this means is that you are treating the object as if it were a function, which it is not. Without me knowing what dio is supposed to be, I cant tell you what to do, but if it is a bindable, move it to ServerStorage and call it with :Invoke / :Fire. If it is a remote, call it with FireClient/Server or InvokeClient/Server.

This discussion is preserved as it was. New answers, comments, and votes are closed.