Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

Example of how I can handle mouseclick1? #220

Closed
leonfresh opened this issue Feb 17, 2023 · 4 comments
Closed

Example of how I can handle mouseclick1? #220

leonfresh opened this issue Feb 17, 2023 · 4 comments

Comments

@leonfresh
Copy link

leonfresh commented Feb 17, 2023

Hi awesome lib. I want to refactor to this but not sure how to re-wire a localScript that has something like this on it:

local ref = script.Parent

ref.MouseButton1Click:Connect(function()	
	RegisterPlayerRemoteEvent:FireServer(localPlayer)
end)

I know there is controllers for client side stuff, but are localscript that is bound to the StarterGui like this still needed? And if so how do I set this up?

I couldnt just use a reference for your controller to listen to this MouseButton1Click, it had to be script.Parent somehow.

Watched some of your tuts on youtube and searched the docs but no answers there.

@howmanysmall
Copy link
Contributor

This isn't a Knit issue. This is a you issue.

@leonfresh
Copy link
Author

leonfresh commented Feb 17, 2023

Yes I'm aware of that, I'm trying to ask a question as I'm new to this lib.
This script fires a event on the server side in its logic, so I'm wondering how to approach it with Knit. It wasnt covered anywhere that I saw

This isn't a Knit issue. This is a you issue.

@Malakai0
Copy link

Well, I recommend watching some tutorials first.

But if you have a Service with a Client method then you could require the Knit library and obtain the service, and then just use Service:Method().

@Sleitnick
Copy link
Owner

Not relevant to Knit

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants