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 not working properly

Previous Thread :: Next Thread 
DeathbringerDev is not online. DeathbringerDev
Joined: 03 Sep 2014
Total Posts: 35
07 Oct 2016 01:47 PM
This script is supposed to check the team color before it welds to the head but i can still do it on both teams? pastebin code: yDKPnzP1
Report Abuse
CodeBreadpudding is not online. CodeBreadpudding
Joined: 24 Aug 2016
Total Posts: 1286
07 Oct 2016 01:54 PM
Lack of end statements.
Report Abuse
CodeBreadpudding is not online. CodeBreadpudding
Joined: 24 Aug 2016
Total Posts: 1286
07 Oct 2016 01:55 PM
No wait I'm blind, why isn't your code properly indented?
Report Abuse
DeathbringerDev is not online. DeathbringerDev
Joined: 03 Sep 2014
Total Posts: 35
07 Oct 2016 01:55 PM
What do you mean by that?
Report Abuse
DeathbringerDev is not online. DeathbringerDev
Joined: 03 Sep 2014
Total Posts: 35
07 Oct 2016 01:57 PM
Its not properly indented most likely because i have almost no clue what i'm doing. I issued a challenge to my self to make a game with no free models to help improve my LUA knowledge.
Report Abuse
CodeBreadpudding is not online. CodeBreadpudding
Joined: 24 Aug 2016
Total Posts: 1286
07 Oct 2016 01:59 PM
http://wiki.roblox.com/index.php?title=Lua_Style_Guide

That should help.
Report Abuse
AggressiveCatch is not online. AggressiveCatch
Joined: 17 Jul 2011
Total Posts: 5840
07 Oct 2016 02:02 PM
roblox studio has that coding helper thing that automatically indents your code properly pretty much...
Report Abuse
DeathbringerDev is not online. DeathbringerDev
Joined: 03 Sep 2014
Total Posts: 35
07 Oct 2016 02:11 PM
So does anyone have a answer to my question? ;.;
Report Abuse
Aliics is online. Aliics
Joined: 29 Sep 2014
Total Posts: 471
07 Oct 2016 03:21 PM
--should work, maybe not


ball = game.Workspace.RedBall

ball.Touched:connect(function(hit)
if game.Players:FindFirstChild(hit.Parent.Name) and not hit.Parent:FindFirstChild(ball) then
local head = hit.Parent['Head']
if ball.Parent == game.Workspace then
local weld = Instance.new('Weld', head)
weld.Part0 = head
weld.Part1 = ball
weld.C0 = CFrame.new(0, 5, 0)
else
if game.Players:FindFirstChild(hit.Parent.Name).TeamColor.Name == 'Cyan' then
local weld = ball.Parent['Head']['Weld']
weld.Parent = hit.Parent['Head']
weld.Part0 = head
weld.Part1 = ball
weld.C0 = CFrame.new(0, 5, 0)
end
end

ball.Parent = hit.Parent
ball.Anchored = false
ball.CanCollide = true
ball.Transparency = 0.5
end
end)





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