generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Can u make scripts private?

Previous Thread :: Next Thread 
albint123 is not online. albint123
Joined: 04 Oct 2014
Total Posts: 29
19 Aug 2017 06:24 AM
Can someone help me I want to know something!
I got a script
And when I place it in starter scripts everyone gets the script.
The script is an web slinger for Spiderman.
And I don't want everyone to have that web slinger only me that is Spiderman.
So How can I make it so that script only applys to me?
I would Love an answer Thank you.
When I make a team and put the script in the team it works in studio but not when I join.
can someone help me?
Report Abuse
LuaDesign is not online. LuaDesign
Joined: 24 May 2010
Total Posts: 1336
19 Aug 2017 06:28 AM
You have upload a module script and use require("rbxassetid://IDForModule") I can't confirm since I haven't used that method what so ever.


Report Abuse
nooneisback is not online. nooneisback
Joined: 28 Feb 2012
Total Posts: 1672
19 Aug 2017 06:30 AM
^This does indeed work, but you should set script = nil to prevent people from reading the source.
Report Abuse
albint123 is not online. albint123
Joined: 04 Oct 2014
Total Posts: 29
19 Aug 2017 06:42 AM
Okay any other ways?
Report Abuse
10MilesWide is not online. 10MilesWide
Joined: 06 Aug 2014
Total Posts: 2220
19 Aug 2017 06:55 AM
Put this at the top of the script

if game.Players.LocalPlayer.UserId ~= game.CreatorId then
return
end
Report Abuse
albint123 is not online. albint123
Joined: 04 Oct 2014
Total Posts: 29
19 Aug 2017 07:12 AM
Did not work btw Were I ment to type my id in creator id?
Report Abuse
10MilesWide is not online. 10MilesWide
Joined: 06 Aug 2014
Total Posts: 2220
19 Aug 2017 07:18 AM
Inside the tool, create a localscript with this code

if game.Players.LocalPlayer.UserId ~= game.CreatorId then
script.Parent:Destroy()
end


The other code didn't work because game.Players.LocalPlayer only works in a localscript
Report Abuse
albint123 is not online. albint123
Joined: 04 Oct 2014
Total Posts: 29
19 Aug 2017 07:24 AM
It is not a tool it is a script that makes that I use the item by pressing e and q!
Report Abuse
nooneisback is not online. nooneisback
Joined: 28 Feb 2012
Total Posts: 1672
19 Aug 2017 11:41 AM
Oh, crap didn't even read the post. The thing me and LuaDesign posted will make a script invisible for anyone but the one who owns it, but can still be used by everybody.

10MilesWide's solution will not work since scripts still run even if they are destroyed. Basically, it doesn't matter which event you use to get the keys, or even if you use a tool, you need to basically check if the user's name is equal to the creator's.

if game.Players.LocalPlayer.UserId ~= game.CreatorId then
local Connection; Connection = Event:Connect(function(whatever_is_here)
if game.Players.LocalPlayer.UserId ~= game.CreatorId then
Connection:Disconnect()
end
--some other stuff
end)
end

This will not even make the connection in case the player isn't you.
Report Abuse
albint123 is not online. albint123
Joined: 04 Oct 2014
Total Posts: 29
20 Aug 2017 04:23 AM
It did not work but thanks anyways I found how I could do it I put the script in ServerStorage and then in game I do give me local and I get the scripts Thanks all people that tryed to help me anyways!
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image