Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How could you find a player in a ModuleScript?

Asked by 6 years ago

I have this LocalScript that calls a module but it will not work ?

require(game:GetService("ServerScriptService").Modules.SwordModules.NormalSword).Run(script.Parent, game.Players.LocalPlayer)

It seems to work on "play solo" but not on real game? Not sure why.

local sword = {}
function sword.Run(tool, plyr)
repeat wait() until tool
    print(plyr.Name)
    print(tool.Name)
end
return sword

1 answer

Log in to vote
0
Answered by 6 years ago

You could load the Module through a require, then have it create a Remote Function or Event. Then get the client to invoke it to do something, it will pass the player as the 1st arg. Here is some documentation, If you need any more help DM me. http://wiki.roblox.com/index.php?title=Remote_Events_and_Functions

0
ill try that, thanks rareheaddress 74 — 6y
0
No problem, If you do need help, don't hesitate to ask. User#9407 0 — 6y
Ad

Answer this question