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
|
  |
| 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 |
|
|
|
| 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
|
  |
| Joined: 04 Oct 2014 |
| Total Posts: 29 |
|
| |
|
|
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|