#weird errors

1 messages · Page 1 of 1 (latest)

honest pine
honest pine
clear finchBOT
#

studio** You are now Level 5! **studio

honest pine
split shoal
#

that’s simple

#

and easy

honest pine
# split shoal because?

What do you mean "because"? Surely you had a reason for using it. What was the intention behind it? Why was it added?

split shoal
#

ohhhh

#

that’s what you mean

#

that’s for equipping different characters

honest pine
split shoal
#

but for some reason those errors appeared and now i don’t see the buttons

honest pine
honest pine
# split shoal remote function

I think we're not quite on the same page.

You asked me "so what should I use" so I assumed you were asking me if you should use RemoteFunction or RemoteEvent.

Are you asking what event & function you should use for RemoteFunctions?

split shoal
honest pine
honest pine
split shoal
honest pine
split shoal
#

ok that one is fixed

honest pine
split shoal
honest pine
#

The first one you forgot an end for your event connection

split shoal
#

fixed

split shoal
#

and my entire punch system just broke randomly

#

this is so annoying

honest pine
honest pine
honest pine
split shoal
honest pine
split shoal
honest pine
split shoal
honest pine
split shoal
honest pine
# split shoal

Because you're trying to use a RemoteFunction. RemoteFunctions do not have OnClient event. I thought that was made ridiculously clear.

Maybe you do want to use a RemoteEvent, but accidentally used RemoteFunction.

split shoal
#

Events.EquipCharacterClient.OnServerInvoke = function(Player, CharacterData)

#

would this work

honest pine
split shoal
#

i will have to try

split shoal
honest pine
split shoal
#

the correct way

#

then i asked a simple question because i was a little confused

#

but you couldn’t take the 10 seconds to think about what i had said

honest pine
# split shoal the correct way

You were trying to use RemoteEvent stuff on a RemoteFunction

So I said that and linked you two docs that contained the correct functions to help you see the things you should be using.

I was hoping that was enough, as you'd read them, see some example code, and be like "oh, that's how RemoteFunctions work, cool" and all would be solved.

But as you responded saying it was still an error, I was confused and thought you did not read anything I was saying

I realized a little bit through that maybe we were having some communication issues

but it just continued to seem that you weren't paying attention to what I was saying.

If the docs were confusing, you could have said "hey these are still confusing. Can you explain?"

But saying "which one do I use", it made it seem like you didn't read it, because the answers were in both of those linked docs.

So I became frustrated because I felt like I was repeating myself and you appeared to ignore it without acknowledging what I gave you

Does that make sense?

split shoal
#

to which you replied “look what i linked”

honest pine
split shoal
honest pine
split shoal
#

any hopefully it works

honest pine
split shoal
#

OnServerInvoke is a callback member of RemoteFunction; you can only set the callback value, get is not available

honest pine
split shoal
#

OnServerInvoke is a callback member of RemoteFunction; you can only set the callback value, get is not available

clear finchBOT
#

studio** You are now Level 6! **studio

split shoal
#

fix one error create another

honest pine
#

So you can set it to the function you want called

split shoal
honest pine
# split shoal i’m a little confused

That's okay!

So OnServerInvoke isn't an event or anything. It's not a function you call or event you connect to.

It looks like one, yeah, but it's just a variable that the RemoteFunction will read to know what to call

So all you're doing is saying "here's the function I want you to run when you are invoked by the client"

split shoal
#

ohhh

#

what should i try then?

honest pine
# split shoal what should i try then?

So do OnServerInvoke = function and the rest of your function

so for example

remoteFunction.OnServerInvoke = function()
     print("The function was used!")
end
split shoal
#

well that’s fixed now

#

and there’s a new error

#

isn’t this wonderful

#

fixed both of those

#

and there’s another one

#

for the love of

#

OnServerInvoke can only be implemented on the server

honest pine
split shoal
honest pine
# split shoal

Yeah, this can only be on the server

How does the equip work? Does the client ask the server to equip a character?

split shoal
honest pine
split shoal
#

when the player joins they are automatically put onto the first class/ the base class

#

in the characters menu they can choose a new character

#

i can show you everything i have so far

honest pine
# split shoal in the characters menu they can choose a new character

So the server would have OnServerInvoke in a script in ServerScriptService.

When that's invoked by the client using InvokeServer, they'd supply the name of the character they want to change into (or whatever you wanna do)

In the server's invoke function, you'd then swap out the player's character for the new one

So two scripts:

  • Server: OnServerInvoke, which contains the function that changes player character
  • Client: InvokeServer with the character to change into
split shoal
honest pine
# split shoal i’m still very confused because my punch was working and i don’t think this line...

Server script

local remoteFunction = game.ReplicatedStorage.RemoteFunction
remoteFunction.OnServerInvoke = function(player, param1, param2)
  print("Player invoked me!", param1, param2)
  return 10
end

Client script

local remoteFunction = game.ReplicatedStorage.RemoteFunction
local resultFromServer = remoteFunction:InvokeServer("first parameter", "second parameter")
print("The server responded!", resultFromServer)
honest pine
honest pine
split shoal
#

i don’t get it

honest pine
split shoal
#

bruh

#

it just deleted everything

#

everything i have

#

might just rtestart

honest pine
# split shoal might just rtestart

I mean the issue is you're still not doing the RemoteFunction right

I have really really tried to explain it to you, giving you examples and docs, but it's just not clicking for you

There's nothing else I can really do here. Maybe someone else can come in and give it a try, maybe they'll explain it in a way that makes more sense for you

honest pine
# split shoal idk what to put

I think that means that you're not familiar enough with programming and lua yet and need to practice more on more basic things. Making a combat system really isn't the best first thing to do

split shoal
#

again i dont know wether its server side or client side

honest pine
#

Character gets changed on the server, client asks the server to change them

split shoal
#

i need to use invokeserver

split shoal
#

@honest pine InvokeServer is not a valid member of RemoteFunction "ReplicatedStorage.Events.EquipCharacterClient"

#

i just dont get it

#

why is roblox coding so bad

honest pine
honest pine
split shoal
#

the script im on rn is a local script

honest pine
split shoal
#

the character client

honest pine
split shoal
#

FINALLY

#

I FIXED THAT ONE

#

HOLY

#

Workspace.GraysenP426.CharacterAttacks.SpecialAttacksInputHandle:48: Expected <eof>, got 'end'

#

what is eof

#

the line of code its directing me to is just an "end"

honest pine
split shoal
honest pine
# split shoal

This is the wrong way to do InvokeServer, plus the code is outside the event rather than inside it

honest pine
split shoal
honest pine
split shoal
#

the error is gone for that one

split shoal
#

it’s saying expected <eof>

honest pine
split shoal
#

oh ok understood

#

ohhh i know why i had that

#

because i had a function there

#

all errors are gone!

#

but now my punch animation is broken

#

sigh

#

all this hard work

#

i think i’m just done with this game

#

@honest pine is it possible to revert back to an old save

honest pine