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

Why can't I put this LocalScript into PlayerScripts?

Asked by 3 years ago
Edited 3 years ago

Ok, so here's my problem. Today, I found out just where I should put my UserInputServiceScript using a module script. Although, when I try to clone the UserInputService script and put it into PlayerScripts, it doesn't work!

Code:

local CombatScript = {}

 function CombatScript.Owner(PlayerName)

    local playerOwner = game:GetService("Players"):FindFirstChild(PlayerName)
    local clone = script.LocalScript:Clone()
    clone.Parent = game:GetService("Players")       [PlayerName]:FindFirstChildOfClass("PlayerScripts") --Why isn't the script going into PlayerScripts?"
    clone:WaitForChild("FindModulePlayer"):Fire(playerOwner)
end

return CombatScript

And here is what I used in Developer console to require it:

require(game.workspace.MainModule).Owner("Howatcha")
0
Putting the localscript in StarterPlayerScripts replicate it into PlaerScripts. located in StarterPlayer MarkedTomato 810 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

Might be a bit of a stupid counter-question, but have you actually run the module script by a regular script? Without it, you wouldn't be able to do so. If you have already done such a thing, then please edit your question with the code where you required the module script. I'll delete my answer afterward.

local test = require(game.ServerScriptService.ModuleScript)
test.Owner("Howatcha")
0
Yes, I have, I will do this. Howatcha 5 — 3y
Ad

Answer this question