How to fix the CFrames tram problem? GetPrimaryPartCFrame [closed]
Asked by
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()
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?