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: Part Touched Help

Previous Thread :: Next Thread 
BlixBlocker is not online. BlixBlocker
Joined: 24 Dec 2013
Total Posts: 657
07 Jun 2015 12:40 PM
So I made a simple tycoon.

Let's say I (BlixBlocker) own a tycoon.
Another person (Shedletsky) walks into my tycoon via door.

He is supposed to die, but he doesn't.

My script:
local player = game.Players.LocalPlayer
local character = player.Character
local humanoid = character.Humanoid

while wait() do
script.Parent.Head.Touched:connect(function(hit)
if hit.Name ~= script.Parent.Parent.Parent.Owner.Value then
hit.Humanoid.Health = 0
end
end)
end


this script is inside of a part named "Head"
Report Abuse
FunkiAndrew is not online. FunkiAndrew
Joined: 01 Dec 2013
Total Posts: 2318
07 Jun 2015 12:41 PM
remove the loop
wow really?
Report Abuse
amanda is not online. amanda
Joined: 21 Nov 2006
Total Posts: 5925
07 Jun 2015 12:59 PM
I'm going to debug your logic errors, but it still may not work without some tweaking.

local Players = game:GetService("Players")

script.Parent.Touched:connect(function(hit)
local character = hit.Parent
if Players:GetPlayerFromCharacter(character) then
if character.Name ~= script.Parent.Parent.Parent.Owner.Value then
character.Humanoid.Health = 0
end
end
end)

--

That probably didn't fix your code entirely, to do that, you need to tell us what's going on. What are you checking and why is this in a local script?
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