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 » Scripting Helpers
Home Search
 

Re: Please help

Previous Thread :: Next Thread 
TreeLineUser is not online. TreeLineUser
Joined: 17 Mar 2013
Total Posts: 1659
20 Jun 2014 09:22 AM
I'm trying to make a script that when a player in on this brick they have a forcefield but when they leave it the forcefield goes away?




script.Parent.Touched:connect(function(otherPart)
if otherPart.Parent:FindFirstChild("Humanoid") ~= nil then
print("Player is on plate!")
script.Parent.Touched:connect(function(p)
if p.Character:FindFirstChild("ForceField") == nil then
ff = Instance.new("ForceField",p.Character)
else
end
end)
end
end)

script.Parent.TouchEnded:connect(function(otherPart)
if otherPart.Parent:FindFirstChild("Humanoid") ~= nil then
print("Player got off the plate!")
script.Parent.Touched:connect(function(p)
p.Character.ForceField:Remove()
end
end
end)
Report Abuse
TrainingToTroll is not online. TrainingToTroll
Joined: 27 Oct 2012
Total Posts: 1757
20 Jun 2014 09:23 AM
Uhm is TouchEnded a thing? Cause I might use that .-.
Report Abuse
TreeLineUser is not online. TreeLineUser
Joined: 17 Mar 2013
Total Posts: 1659
20 Jun 2014 09:23 AM
the question mark is suppose to be a period i want it to go awya when they leave the brick.
Report Abuse
TrainingToTroll is not online. TrainingToTroll
Joined: 27 Oct 2012
Total Posts: 1757
20 Jun 2014 09:24 AM
wat.
Report Abuse
TreeLineUser is not online. TreeLineUser
Joined: 17 Mar 2013
Total Posts: 1659
20 Jun 2014 09:25 AM
When i was explaining what i wanted the script to do i put a question mark after it when it was suppose to be a period.
Report Abuse
TreeLineUser is not online. TreeLineUser
Joined: 17 Mar 2013
Total Posts: 1659
20 Jun 2014 09:30 AM
Bump
Report Abuse
TreeLineUser is not online. TreeLineUser
Joined: 17 Mar 2013
Total Posts: 1659
20 Jun 2014 10:20 AM
bump
Report Abuse
COOLDUDE11OO is not online. COOLDUDE11OO
Joined: 21 Aug 2011
Total Posts: 5115
20 Jun 2014 10:42 AM
Try region3, and Forcefield might be nil.
Report Abuse
VerifiedName is not online. VerifiedName
Joined: 26 Jul 2009
Total Posts: 4534
20 Jun 2014 10:54 AM
not sure if this is what you mean, but okay.

script.Parent.Touched:connect(function(hit)
local human = hit.Parent:findFirstChild('Humanoid');
if human ~= nil then
local ff = human.Parent:findFirstChild('ff');
if ff == nil then
local newff = Instance.new('ForceField', human.Parent);
newff.Name = 'ff';
end
end
end)
script.Parent.TouchEnded:connect(function(hit)
local human = hit.Parent:findFirstChild('Humanoid');
if human ~= nil then
local ff = human.Parent:findFirstChild('ff');
if ff ~= nil then
ff:Destroy();
end
end
end)

Report Abuse
TreeLineUser is not online. TreeLineUser
Joined: 17 Mar 2013
Total Posts: 1659
20 Jun 2014 04:57 PM
Thank you very much verified.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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