Script doesnt work even though there is no errors at all

actually just hold on im gonna record a video showing everything

as @Razor_IB said “you have to connect events” now what you showed us in the screenshot was:
Click.MouseRightClick(function()
ir maybe you changed the script already and still not working which is odd

putting a == for the if statement just makes the jumpplatform a unknown global

1 Like

i see it in the main video:
IMG_20210203_205303

1 Like
  1. You are not connecting the RightMouseClick event to a function , you are directly calling it.

  2. GloveMode.JumpPlatform ← This function returns nil upon calling so your if condition : if GloveMode.JumpPlatform() then will never run.

2 Likes

because the right click is for changing modes for the glove

i dont think you really get what we are saying here… id like you to try adding this:
Click.RightMouseClick:Connect(function()

1 Like

i already did and doesnt work
image

You have to connect events to function , else it won’t run . You can’t call events like functions . Also read the second thing I told again.

you prob should try the second thing @Razor_IB said

This won’t make any difference… it’s been said 2 times that the if statement isn’t ever going to run-

@BuilderityRBLX Put a print inside the MouseClick event before the if statement, and you should see it print. Put it inside that if statement, it won’t print. Your function never returns and the if statement doesn’t run.

2 Likes

ok so i fixed everything i think but the only error now is the if statement
and how do i fix that if statement
?

1 Like

trying to figure it out right now… :smiley:

off topic but how do u do the quote thing like how you show a certain part of someone’s comment im new to the forum so

1 Like

just select the specific text and there will be a quote button above it!
image

Make the JumpPlatform function return any value

i dont know anything about returning value stuff …

First, add this to JumpPlatform() function in your script. (Last Line)

return true

Then, change your clickdetector script to this(also make it a local script and put it in starterpack):

local clickdetector = game.workspace:FindFirstChild("TheNameOfTheClickDetectorPart").ClickDetector
clickdetector.RightMouseClick:Connect(function()
     local PlatformMode = require(script.PlatformMode)
     local GloveMode = require(game.Players.LocalPlayer.Backpack.Tool.GloveModule)
     local modulefunction = GloveModule.JumpPlatform()
     if modulefunction == true then
          PlatformMode.JumpPlatform()
     end
end)

that gave me a idea

yes, starter gear does replicate in clients… meaning that thats better to do!! and mostly could fix the problem

1 Like

nope, still didnt work :grimacing:

@BuilderityRBLX it whould fix the problem since if you call the StarterGear it whould mean its the server… but when you call the main player’s backpack it whould work, maybe what was happening is the connect thing and the second problemo was the server could see it but not the client… anyways

making it short whould be:

ur calling the tool on StarterGear meaning it does the changes to the server and not the client