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: whatWHAT?!?!

Previous Thread :: Next Thread 
KingJacko is not online. KingJacko
Joined: 20 Jun 2008
Total Posts: 3944
10 May 2015 05:28 AM
SelectedTank.Value = OwnedTanks[TankButton.Name]
print(TankButton.Name, SelectedTank.Value)

the tankbutton's name is "TestTank" yet the print gives me "TestTank3" for each one. what what what. I suppose you would need this too, which is how i created it.

for i = 1, #Tanks do
if Tanks[i].Name == SelectedTank.Value.Name then--dont show selectedtank
TankSkipped = true
print("Skipped: "..Tanks[i].Name)
else
TankButton = Instance.new("TextButton")
TankButton.Parent = TankListFrame
TankButton.Size = UDim2.new(1,0,0,20)
if TankSkipped then
TankButton.Position = UDim2.new(0,0,0,(i * 20)-40)
else
TankButton.Position = UDim2.new(0,0,0,(i * 20)-20)
end
TankButton.BackgroundColor3 = Color3.new(0,0,0)
TankButton.BackgroundTransparency = 1
TankButton.BorderSizePixel = 0

TankButton.Font = "SourceSansBold"
TankButton.FontSize = "Size18"
TankButton.TextColor3 = Color3.new(1,1,1)
TankButton.TextXAlignment = "Left"
TankButton.Text = Tanks[i].Name
TankButton.Name = Tanks[i].Name
end
Report Abuse
KingJacko is not online. KingJacko
Joined: 20 Jun 2008
Total Posts: 3944
10 May 2015 06:12 AM
help
Report Abuse
KingJacko is not online. KingJacko
Joined: 20 Jun 2008
Total Posts: 3944
10 May 2015 06:40 AM
im confusedddddd
Report Abuse
epicbreaker is not online. epicbreaker
Joined: 23 Apr 2011
Total Posts: 2791
10 May 2015 06:55 AM
You're missing an end.

Is SelectedTank an object value?
If not.. Why are you using: "SelectedTank.Value.Name"

print("Skipped: "..Tanks[i].Name)
If it keeps printing this.. You're always getting Tanks[3] because SelectedTank is what's causing this.
Report Abuse
KingJacko is not online. KingJacko
Joined: 20 Jun 2008
Total Posts: 3944
10 May 2015 07:10 AM
"You're missing an end."

this isnt the whole script, and i would be getting an error.
Report Abuse
KingJacko is not online. KingJacko
Joined: 20 Jun 2008
Total Posts: 3944
11 May 2015 05:18 AM
so i would have to change selectedtank(object value) to a string?
Report Abuse
superbobman is not online. superbobman
Joined: 29 Nov 2008
Total Posts: 939
11 May 2015 06:23 AM
Use tostring(variable)

It converts any type of data to a string
Report Abuse
KingJacko is not online. KingJacko
Joined: 20 Jun 2008
Total Posts: 3944
12 May 2015 05:19 AM
so i should switch it to a string
ok
Report Abuse
KingJacko is not online. KingJacko
Joined: 20 Jun 2008
Total Posts: 3944
12 May 2015 05:32 AM
heres the full function because i changed everything and it still doesnt work

function SwitchTank()
if GarageFrame:FindFirstChild("TankList") then
GarageFrame:FindFirstChild("TankList"):Destroy()
else
Tanks = OwnedTanks:GetChildren()

TankListFrame = Instance.new("ScrollingFrame")
TankListFrame.Parent = GarageFrame
TankListFrame.Size = UDim2.new(0,200,0,200)
TankListFrame.Position = UDim2.new(0.5,-100,0.5,-100)
TankListFrame.CanvasSize = UDim2.new(0,0,0,(#Tanks * 20))
TankListFrame.BackgroundColor3 = Color3.new(0,0,0)
TankListFrame.BackgroundTransparency = 0.5
TankListFrame.BorderSizePixel = 0
TankListFrame.Name = "TankList"

local TankSkipped = false

for i = 1, #Tanks do
if Tanks[i].Name == tostring(SelectedTank.Value) then
TankSkipped = true
print("Skipped: "..Tanks[i].Name)
else
TankButton = Instance.new("TextButton")
TankButton.Parent = TankListFrame
TankButton.Size = UDim2.new(1,0,0,20)
if TankSkipped then
TankButton.Position = UDim2.new(0,0,0,(i * 20)-40)
else
TankButton.Position = UDim2.new(0,0,0,(i * 20)-20)
end
TankButton.BackgroundColor3 = Color3.new(0,0,0)
TankButton.BackgroundTransparency = 1
TankButton.BorderSizePixel = 0

TankButton.Font = "SourceSansBold"
TankButton.FontSize = "Size18"
TankButton.TextColor3 = Color3.new(1,1,1)
TankButton.TextXAlignment = "Left"
TankButton.Text = Tanks[i].Name
TankButton.Name = Tanks[i].Name
end
end
for _, Button in pairs(TankListFrame:GetChildren()) do
Button.MouseButton1Click:connect(function()
Garage:WaitForChild("Tank"):ClearAllChildren()

SelectedTank.Value = tostring(TankButton.Name)
print(TankButton.Name, SelectedTank.Value)

Tank = OwnedTanks[tostring(SelectedTank.Value)]:Clone()
Tank.Parent = Garage:WaitForChild("Tank")
Tank.PrimaryPart = Tank:WaitForChild("Hull")
Tank:SetPrimaryPartCFrame(Garage:WaitForChild("Podium").CFrame + Vector3.new(0,2,0))
Tank:WaitForChild("Turret").BottomSurface = "Weld"
Tank:WaitForChild("Hull").TopSurface = "Smooth"
Tank:MakeJoints()

TankListFrame:Destroy()

UpdateGuis()
end)
end
end
end

i am NOT getting any errors
Report Abuse
KingJacko is not online. KingJacko
Joined: 20 Jun 2008
Total Posts: 3944
13 May 2015 05:23 PM
i changed SelectedTank to StringValue and used the about script.

I really need help.

All i need to know is the problem
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