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

Im getting (The function InvokeClient is not a member of "Player") in output?

I tried having the client side reading a server side number value in the player but dosnt read the value right:

Client-Side:

local Values = game.ReplicatedStorage:WaitForChild("RemoteFunction")

script.Parent.ClickDetector.MouseClick:Connect(function(player)
	if script.Parent.Parent.Player.Value == "" then
		script.Parent.Parent.Player.Value = player.Name
	end
	if player.Name == script.Parent.Parent.Player.Value then
		print("jwilenqgnblqnbw")
		local equiped = Values.InvokeClient(player)
		print(equiped) --Prints the value (Supposed to be 1 but prints 0)
		player.Character.Humanoid:EquipTool(player.Backpack:FindFirstChild(equiped))
		wait(0.150)
		if equiped == "lvl1" then
			script.Parent.Parent.Hits.BillboardGui.Damage.Text = script.Parent.Parent.Hits.BillboardGui.Damage.Text - 5
		end
		script.Parent.Chop1:Play()
		script.Parent.Parent.Particles.ParticleEmitter.Enabled = true
		wait(0.2)
		script.Parent.Parent.Particles.ParticleEmitter.Enabled = false
		wait(0.2)
		local axe = player.Character:WaitForChild(equiped):Clone()
		axe.Parent = player.Backpack
		player.Character:FindFirstChild(equiped):Destroy()
	end
	print(script.Parent.Parent.Hits.BillboardGui.Damage.Text)
	if script.Parent.Parent.Hits.BillboardGui.Damage.Text == "0" then
		script.Parent.Parent.PrimaryPart = nil
		print("Event fire attempt")
		game.ReplicatedStorage.Logg:FireClient(player)
		wait(5)
		print("Destroying")
		game.ReplicatedStorage.RemoteEvent:FireAllClients(script.Parent.Parent)
	end
end)

Server-Side localscript in playerstarterscriptps:

local function invoke()
	return script.Parent.Parent.AxeLvl.Value
end

game.ReplicatedStorage.RemoteFunction.OnClientInvoke = invoke

4 comments

0

I'm a bit confused here, you are saying that the top script is the client side, yet you use FireAllClients on it, which is a function exclusive to the server

0

So is that because you confused the terms "Client" and "Server"?

0

yes im confused

0

I fixed some indentation.

1 answer

✓ Accepted answer

You should use : instead of . here:

 local equiped = Values:InvokeClient(player) -- change . to :
10	    print(equiped)

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