Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Script running on Studio but not Working on my published place?

Hi again ScriptingHelpers Community!,

I have a little problem here, I made a script based on the API documentation, and a big informative help about a user from this community.

My script it's supossed to Play an animation when the Player press LShift and Stop it progressively when you release the LShift Button, we're good here.

My problem is: When I published to Roblox (my place) with the Script on the "StarterPack" folder and Play my place, it doesn't work. I mean that it looks like it's not being loaded.

So my question is: What am I missing?

I really appreciate any help you can provide.

Edit: This is what I've placed on top of the script in order to get the LocalPlayer

--// Services
local Players = game:GetService("Players")
local UIS = game:GetService("UserInputService")

--// Local Variables
local player = Players.LocalPlayer

--// .... code

4 comments

0

Are you using a localscript? B/c if you're using "LocalPlayer" & the "UserInputService," it's required to use it.

0

Yes, well, I think so, I'll update the post with the a part of the code I'm using

0

A localscript has a little person on it, while a server script is just a script with nothing on it. Which one are you using?

0

You mean a Dummy? I've one of those placed on it but I used it only for animations. Is that what you mean?

1 answer

✓ Accepted answer

Use a local script!


Whether you're using Filtering Enabled or not, you need to use a LocalScript for any of the following:

  • User Input
  • Graphical Interface
  • LocalPlayer

Note:

LocalScripts don't work in places like ServerScriptService, Workspace, Storage/Lighting.


Having a local script in StarterPack would work fine.

(If you're still having trouble, add some print statements and press f9 while in a server to view the log.)

3 comments

0

I though that the script you pasted on my last question was a LocalScript and I'm based on it. It's on the StarterPack as you said. There's nothing on server when I hit F9.

0

Local Script code isn't the same as a Local Script. You have to put the code in a Local Script.

0

Oh, I was misunderstanding the meaning of LocalScript, I thought it was the same thing. My script doesn't have any error (in this particular case). I was saving it as a "script" instead of a "localscript". Again, Thank you very much for your help!

This discussion is preserved as it was. New answers, comments, and votes are closed.