|
| 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 |
|
|
| |
|
|
| 07 Oct 2016 01:55 PM |
| No wait I'm blind, why isn't your code properly indented? |
|
|
| Report Abuse |
|
|
| |
|
|
| 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 |
|
|
|
| 07 Oct 2016 01:59 PM |
http://wiki.roblox.com/index.php?title=Lua_Style_Guide
That should help. |
|
|
| Report Abuse |
|
|
|
| 07 Oct 2016 02:02 PM |
| roblox studio has that coding helper thing that automatically indents your code properly pretty much... |
|
|
| Report Abuse |
|
|
|
| 07 Oct 2016 02:11 PM |
| So does anyone have a answer to my question? ;.; |
|
|
| Report Abuse |
|
|
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 |
|
|