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: Script won't work

Previous Thread :: Next Thread 
HexagonCode is not online. HexagonCode
Joined: 09 Dec 2015
Total Posts: 1216
11 Dec 2016 04:25 AM
Hey Guys,

I have a problem with a Script. I want to make the Parts Material to Neon when a Player touches it. But it works only on 1 Part, I want them working on all when a Player step on it.

The place:

https://www.roblox.com/games/569296834/HexagonCodes-Place-Number-280

The Code:

function onTouched(part)

while true do
script.Parent.Union.Material = ("Neon")
wait(1)
script.Parent.Union.Material = ("SmoothPlastic")
wait(0.2)
break
end
end

C = script.Parent.Union.Touched:connect(onTouched)
Report Abuse
HexagonCode is not online. HexagonCode
Joined: 09 Dec 2015
Total Posts: 1216
11 Dec 2016 06:12 AM
Bump
Report Abuse
HexagonCode is not online. HexagonCode
Joined: 09 Dec 2015
Total Posts: 1216
11 Dec 2016 08:51 AM
Bump
Report Abuse
RaulChaser is not online. RaulChaser
Joined: 07 Dec 2014
Total Posts: 655
11 Dec 2016 08:52 AM
All at once?
Report Abuse
memorycode is not online. memorycode
Joined: 24 Sep 2011
Total Posts: 3322
11 Dec 2016 08:53 AM
script.Parent.Union.Touched:Connect(function(part)
script.Parent.Union.Material = ("Neon")
wait(1)
script.Parent.Union.Material = ("SmoothPlastic")
wait(0.2)
end)




i'm not any more should not the panda and?
Report Abuse
RaulChaser is not online. RaulChaser
Joined: 07 Dec 2014
Total Posts: 655
11 Dec 2016 08:55 AM

for i, v in pairs(script.Parent:GetChildren()) do
if v:isA("UnionOperation") then
v.Touched:connect(function()
for i, v in pairs(script.Parent:GetChildren()) do
if v:isA("UnionOperation") then
v.Material = ("Neon")
end
end
wait(1)
for i, v in pairs(script.Parent:GetChildren()) do
if v:isA("UnionOperation") then
v.Material = ("SmoothPlastic")
end
end
end)
end
end
Report Abuse
HexagonCode is not online. HexagonCode
Joined: 09 Dec 2015
Total Posts: 1216
11 Dec 2016 09:48 AM
@RaulChaser

Not all at once but thank you for your help!
Only the Part wich the Player stepped on should get Neon
Report Abuse
HlCOM is not online. HlCOM
Joined: 29 Mar 2009
Total Posts: 3332
11 Dec 2016 10:17 AM
for i,v in ipairs (model:GetChildren()) do
if v:IsA('UnionOperation') then
v.Touched:Connect(function(part)
if part.Parent:FindFirstChild('Humanoid') then
v.Material = Enum.Material.Neon
wait(1)
v.Material = Enum.Mateiral.SmoothPlastic
end
end)
end
end


http://wiki.roblox.com/?title=Loops
Report Abuse
HexagonCode is not online. HexagonCode
Joined: 09 Dec 2015
Total Posts: 1216
11 Dec 2016 10:48 AM
@HlCOM

It works! Thanks for your help.
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