|
| 28 Dec 2011 12:00 PM |
I put all building tools into lighting and put station tool in starterpack. I selected station tool. What I want to happen was it to make the station and remove the station tool then make tools appear out of lighting, but instead, the station tool didn't make a station even when I clicked. Do you know what is causing this?
I tried technical issues. It didn't work out. So i posted it here to see if you can figure this out. |
|
|
| Report Abuse |
|
|
|
| 28 Dec 2011 12:02 PM |
Heres the station script btw: ---------------------------------------------------------
function Hint(s, p, t, c) local h = Instance.new("Hint") if s then h.Text = s h.Name = "Hint" if p then if p:findFirstChild("Hint") ~= nil then p.Hint:remove() end h.Parent = p if t then if c then coroutine.resume(coroutine.create(function() wait(t) h:Remove() end)) else wait(t) h:Remove() end end end end return h end
-------------------------------------------------------- function onButton1Down(mouse)
if placed == true then if m ~= nil then
t = game.Lighting.Track:clone() t.Parent = script.Parent.Parent--TRACK TOOL s = game.Lighting.Supports:clone() s.Parent = script.Parent.Parent--SUPPORTS TOOL c = game.Lighting.Appearance:clone() c.Parent = script.Parent.Parent--COLOR TOOL v = game.Lighting.Velocity:clone() v.Parent = script.Parent.Parent--VELOCITY TOOL o = game.Lighting.Options:clone() o.Parent = script.Parent.Parent--OPTIONS TOOL
if player:findFirstChild("Hint") ~= nil then player:findFirstChild("Hint"):remove() end Hint("Please select the track tool to start building.", player, 3, true) script.Parent:remove() end end
if placed == false then --Putting in a station position = selection.Selection.Position if position.y > 10 then print("Too high") elseif mouse.Target == nil then print("Too far") else
selection:remove() select = false
m = Instance.new("Model") m.Name = script.Parent.Parent.Parent.Name .. "'s Coaster" m.Parent = game.Workspace
s = station:clone() s.Parent = m s:moveTo(position) s:makeJoints()
s.Name = "Station"
cc = s.CountCars:clone() s.CountCars:remove() cc.Disabled = false cc.Parent = s placed = true h = Instance.new("Hint") h.Text = "Are you sure about your station? Click to continue, deselect to restart." h.Parent = player end end end --------------------------------------------------------- function onButton1Up(mouse)
end --------------------------------------------------------- function onKeyDown(key) if (key~=nil) then key = key:lower() if (key=="r") and selection ~= nil then if num == 1 then selection.Selection.CFrame = selection.Selection.CFrame * CFrame.fromEulerAnglesXYZ(0,math.pi/2,0) station = ps.Station2 num = 2 print("Rotate") elseif num == 2 then selection.Selection.CFrame = selection.Selection.CFrame * CFrame.fromEulerAnglesXYZ(0,math.pi/2,0) station = ps.Station3 num = 3 print("Rotate") elseif num == 3 then selection.Selection.CFrame = selection.Selection.CFrame * CFrame.fromEulerAnglesXYZ(0,math.pi/2,0) station = ps.Station4 num = 4 print("Rotate") elseif num == 4 then selection.Selection.CFrame = selection.Selection.CFrame * CFrame.fromEulerAnglesXYZ(0,math.pi/2,0) station = ps.Station1 num = 1 print("Rotate") end end
--if (key == "m") and selection ~= nil then --if tracknum == 1 then --print("Change") --tracknum = 2 --str = station.Name --Clever --ps = game.Lighting.InvertedCoaster --station = ps:findFirstChild(str) --Hint("Select your starting point. Press 'R' to rotate. Press 'M' to choose different tracks. Current Track: " .. ps.Name, player, 4, true) --elseif tracknum == 2 then --print("Change") --tracknum = 1 --str = station.Name --Clever --ps = game.Lighting.SingleRailCoaster --station = ps:findFirstChild(str) --Hint("Select your starting point. Press 'R' to rotate. Press 'M' to choose different tracks. Current Track: " .. ps.Name, player, 4, true) --elseif tracknum == 3 then --print("Change") --tracknum = 1 --str = station.Name --Clever --ps = game.Lighting.SingleRailCoaster --station = ps:findFirstChild(str) --Hint("Select your starting point. Press 'R' to rotate. Press 'M' to choose different tracks. Current Track: " .. ps.Name, player, 4, true) --end --end end end --------------------------------------------------------- function onSelected(mouse) mouse.Icon = "rbxasset://textures\\GunCursor.png" player = script.Parent.Parent.Parent if player == nil then return end mouse.Button1Down:connect(function() onButton1Down(mouse) end) mouse.Button1Up:connect(function() onButton1Up(mouse) end) mouse.KeyDown:connect(onKeyDown)
if player:findFirstChild("Hint") ~= nil then player:findFirstChild("Hint"):remove() end -- CLEAR MSGS
ps = game.Lighting.SingleRailCoaster placed = false num = 1 station = ps.Station1 tracknum = 1
selection = ps.Selection:clone() selection.Parent = player.Character
select = true selection.Selection.Position = Vector3.new(0,0,0) -- Stops weird bug wait(.1)
Hint("Select your starting point. Press 'R' to rotate.", player, 4, true)
while select do if mouse.Target ~= nil then selection.Selection.Position = calculatePosition(mouse.Origin.p, mouse.Hit, selection.Selection) end wait() end mouse.Icon = "rbxasset://textures\\ArrowCursor.png"
end --------------------------------------------------------- function onDeselected(mouse) if placed == true then m:remove() end if select == true then select = false selection:remove() end things = script.Parent.Parent.Parent:GetChildren() for i=1,#things do if things[i].Name == "Hint" or things[i].Name == "Message" then things[i]:remove() end end end --------------------------------------------------------- function calculatePosition(start, pos, brick) local bottom = brick.Position.y - brick.Size.y/2 local dy1 = pos.y - start.y local dy2 = bottom - start.y local ratio = dy2/dy1 return snap(start.x + (pos.x-start.x)*ratio, start.y + (pos.y-start.y)*ratio, start.z + (pos.z-start.z)*ratio) end --------------------------------------------------------- function snap(x, y, z) return Vector3.new(math.floor(x), 0.4*math.floor(y*2.5), math.floor(z)) end --------------------------------------------------------- script.Parent.Selected:connect(onSelected) script.Parent.Deselected:connect(onDeselected) |
|
|
| Report Abuse |
|
|
|
| 28 Dec 2011 12:04 PM |
| idk about you but I'M not gonna read that :P |
|
|
| Report Abuse |
|
|
dirk29
|
  |
| Joined: 26 May 2010 |
| Total Posts: 1142 |
|
|
| 28 Dec 2011 12:10 PM |
| Give us the output and the place for error. |
|
|
| Report Abuse |
|
|
|
| 28 Dec 2011 12:13 PM |
Oh dear, i'll never get this, idk where the error is, the output said this: 11:12:49 - SingleRailCoaster is not a valid member of Lighting 11:12:49 - Script "Players.monkey1589.Backpack.Station.Station", Line 149 11:12:49 - stack end 11:12:49 - Disconnected event because of exception
I'll work on the rail.
|
|
|
| Report Abuse |
|
|
|
| 28 Dec 2011 12:15 PM |
line 149 is :
if player:findFirstChild("Hint") ~= nil then player:findFirstChild("Hint"):remove() end -- CLEAR MSGS
|
|
|
| Report Abuse |
|
|
dirk29
|
  |
| Joined: 26 May 2010 |
| Total Posts: 1142 |
|
|
| 28 Dec 2011 12:17 PM |
if player:FindFirstChild("Hint") then for i,v in pairs(player:GetChildren()) do if v:Isa("Hint") then v:remove() end end end |
|
|
| Report Abuse |
|
|
|
| 28 Dec 2011 12:18 PM |
your problem is this line here:
ps = game.Lighting.SingleRailCoaster
You should probably make sure everything is spelled right and that 'SingleRailCoaster' is not in a Model. |
|
|
| Report Abuse |
|
|
|
| 28 Dec 2011 12:20 PM |
Now the output said this: 11:18:31 - Station1 is not a valid member of Part 11:18:31 - Script "Players.monkey1589.Backpack.Station.Station", Line 152 11:18:31 - stack end 11:18:31 - Disconnected event because of exception
Station1 is not a valid member of Part, what does that mean.
Line 152 is this:
station = ps.Station1 |
|
|
| Report Abuse |
|
|
|
| 28 Dec 2011 12:23 PM |
| Again, just make sure everything is spelled right and stuff. It's saying it can't find Station1 inside of 'ps'. |
|
|
| Report Abuse |
|
|