Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How to fix the CFrames tram problem? GetPrimaryPartCFrame [closed]

Asked by
kapipi12 133
6 years ago
Edited 6 years ago


--How I can make it going to front even without stopping just on key w (i mean, no one press and it is going, I need it like in cars, you have to push it to work)? My script code is:
local trammodel = script.Parent.Parent.Parent
local tramwheels = trammodel.TramChasis
local driving = false
local seat = false
local Player = game.Players.LocalPlayer
local mouse = Player:GetMouse()


--POLISH VERSION WHAT TO DO:
-- DO ZROBIENIA:
-- ogarn?? cframe modelu  
-- ogarn?c przycisk s (cofanie b?d? hamowanie)
-- ogarn?? je?d?enie po torach

while true do
    function PressW(key)
        if (key == "W") then
            wait(10)
            driving = true
            for i = 1,400 do
                trammodel:SetPrimaryPartCFrame(trammodel:GetPrimaryPartCFrame() * CFrame.new(0,0,1))
                wait(0.1)
            end
        end
    end
end










--while true do
--  script.Parent.Touched:Connect(function(hit)
--      if hit.Parent then
--          local player = game.Players:GetPlayerFromCharacter(hit.Parent)
--          if hit.Parent:FindFirstChild('Humanoid') then
--              hit.Parent.Humanoid.Seated:connect(function (active, seat,pressw)
--                  if player ~= nil then
--                      if active == true and seat == script.Parent and pressw == true then
--                          end
--                      end
--                  end
--              end)
--          end
--      end
--  end)
--end
PressW()


0
what do u mean User#23365 30 — 6y
0
also naming your function wont actually do what the functions name is, you need to connect a event User#23365 30 — 6y
0
What's with this pre class? Shawnyg 4330 — 6y
0
Lol, pretty sure ROBLOX doesn't support HTML in games, but just RLua or sometimes Json. oilsauce 196 — 6y

Closed as Too Broad by Goulstem

This question has been closed because it is too broad and is generally unanswerable. Please ask a more specific question.

Why was this question closed?