cody20175
|
  |
| Joined: 23 Jul 2010 |
| Total Posts: 6958 |
|
|
| 06 Jun 2014 10:23 AM |
So basically, it's a script that teleports you to the lobby if you click a button, and it gives you a forcefield.
plr = game.Players.LocalPlayer script.Parent.MouseButton1Click:connect(function() plr.Character.Torso.CFrame = CFrame.new(0,0,0) Instance.new("ForceField", plr) end)
The one to take away forcefield
plr = game.Players.LocalPlayer script.Parent.MouseButton1Click:connect(function() plr.Character.Torso.CFrame = CFrame.new(0,0,0) plr:FindFirstChild:("ForceField"):Destroy() --i know this one's wrong, please help end)
got hacked out of CF+ by horsdoeuvres |
|
|
| Report Abuse |
|
|
Ultraw
|
  |
| Joined: 20 Nov 2010 |
| Total Posts: 6575 |
|
| |
|
|
| 06 Jun 2014 10:27 AM |
local player = game.Players.LocalPlayer local character = player.Character local forceField = false
function giveForceField() if character then Instance.new("ForceField", character) end end
function removeForceField() if character and character:FindFirstChild("ForceField") then character.ForceField:Destroy() end end
script.Parent.MouseButton1Click:connect(function() if not forceField then giveForceField() else removeForceField() end)
Just so it's easy to break down and learn from. |
|
|
| Report Abuse |
|
|
|
| 06 Jun 2014 10:28 AM |
| You can add the teleports. |
|
|
| Report Abuse |
|
|
cody20175
|
  |
| Joined: 23 Jul 2010 |
| Total Posts: 6958 |
|
|
| 06 Jun 2014 10:29 AM |
um You realize that's a non-working script right?
got hacked out of CF+ by horsdoeuvres |
|
|
| Report Abuse |
|
|
| |
|
cody20175
|
  |
| Joined: 23 Jul 2010 |
| Total Posts: 6958 |
|
|
| 06 Jun 2014 10:30 AM |
oh @Ultraw
I haven't tried it yet, I was just about to, but I wanted opinions
got hacked out of CF+ by horsdoeuvres |
|
|
| Report Abuse |
|
|
cody20175
|
  |
| Joined: 23 Jul 2010 |
| Total Posts: 6958 |
|
|
| 06 Jun 2014 10:30 AM |
Yes @xx
The events, there are no functions, it would not work, the way it's set-up. BRB testing it
got hacked out of CF+ by horsdoeuvres |
|
|
| Report Abuse |
|
|
|
| 06 Jun 2014 10:31 AM |
| Oops lol I just woke up, I'll fix it. |
|
|
| Report Abuse |
|
|
|
| 06 Jun 2014 10:32 AM |
I forgot to change the bool value, silly mistake. The code should work.
local player = game.Players.LocalPlayer local character = player.Character local forceField = false
function giveForceField() if character then Instance.new("ForceField", character) end end
function removeForceField() if character and character:FindFirstChild("ForceField") then character.ForceField:Destroy() end end
script.Parent.MouseButton1Click:connect(function() if not forceField then giveForceField() forceField = not forceField else removeForceField() forceField = not forceField end end) |
|
|
| Report Abuse |
|
|
cody20175
|
  |
| Joined: 23 Jul 2010 |
| Total Posts: 6958 |
|
|
| 06 Jun 2014 10:39 AM |
plr = game.Players.LocalPlayer char = plr.Character script.Parent.MouseButton1Click:connect(function() plr.Character.Torso.CFrame = CFrame.new(0,0,0) Instance.new("ForceField", char) end)
The one to take away forcefield
plr = game.Players.LocalPlayer char = plr.Character script.Parent.MouseButton1Click:connect(function() plr.Character.Torso.CFrame = CFrame.new(0,0,0) char:FindFirstChild:("ForceField"):Destroy() --i know this one's wrong, please help end)
got hacked out of CF+ by horsdoeuvres |
|
|
| Report Abuse |
|
|
|
| 06 Jun 2014 10:39 AM |
| The code I posted is a fully functional forcefield giver/remover on click. |
|
|
| Report Abuse |
|
|
|
| 06 Jun 2014 10:41 AM |
-- local player = game.Players.LocalPlayer local character = player.Character local forceField = false
function teleportToLobby() if character then character.Torso.CFrame = CFrame.new(0, 0, 0) end end
function teleportToBattle() if character then character.Torso.CFrame = CFrame.new(0, 0, 0) end end
function giveForceField() if character then Instance.new("ForceField", character) end end
function removeForceField() if character and character:FindFirstChild("ForceField") then character.ForceField:Destroy() end end
script.Parent.MouseButton1Click:connect(function() if not forceField then giveForceField() teleportToLobby forceField = not forceField else removeForceField() teleportToBattle forceField = not forceField end end)
cus u too lazy |
|
|
| Report Abuse |
|
|
|
| 06 Jun 2014 10:42 AM |
| err ma gud i commented the first line, undo that. |
|
|
| Report Abuse |
|
|
|
| 06 Jun 2014 10:43 AM |
Ok I fully test this code and it works. I forgot the () on the functions.
local player = game.Players.LocalPlayer local character = player.Character local forceField = false
function teleportToLobby() if character then character.Torso.CFrame = CFrame.new(0, 0, 0) end end
function teleportToBattle() if character then character.Torso.CFrame = CFrame.new(0, 0, 0) end end
function giveForceField() if character then Instance.new("ForceField", character) end end
function removeForceField() if character and character:FindFirstChild("ForceField") then character.ForceField:Destroy() end end
script.Parent.MouseButton1Click:connect(function() if not forceField then giveForceField() teleportToLobby() forceField = not forceField else removeForceField() teleportToBattle() forceField = not forceField end end) |
|
|
| Report Abuse |
|
|
|
| 06 Jun 2014 10:54 AM |
| If he's using Filtering in his game, the force field will not replicate to the server. |
|
|
| Report Abuse |
|
|
|
| 06 Jun 2014 10:55 AM |
| Well I don't know a thing about this new fancy options and services. |
|
|
| Report Abuse |
|
|
|
| 06 Jun 2014 10:58 AM |
| FilteringEnabled makes it so that anything that you do on the client will not replicate over to the server without the use of RemoteFunctions/RemoteEvents. |
|
|
| Report Abuse |
|
|
|
| 06 Jun 2014 11:07 AM |
Its great to stop exploitation.
But yeah,
http://wiki.roblox.com/index.php?title=Security |
|
|
| Report Abuse |
|
|