I’m trying to make a snowboarding game and now I’m on the part of making the snowboard move and for some reason when I press w the board doesn’t move!
First I use the UserInput service as a local script to change a part’s transparency (This script works just fine!)
local UserInputService = game:GetService('UserInputService')
local MovementControl = game.Workspace.DevSnowboard.MovementControl
local BodyForceController = game.Workspace.DevSnowboard.BodyForceController
local function Movement()
if MovementControl.Transparency == 0 then
print"Movement for snowboard is now active"
end
UserInputService.InputBegan:Connect(function(input,gameProccesedEvent)
if input.KeyCode == Enum.KeyCode.W then
print"Pressed w"
BodyForceController.Transparency = 0
end
end)
end
MovementControl:GetPropertyChangedSignal("Transparency"):Connect(Movement)
Then I use the body force script this is the script that is not working!
local BodyForce = script.Parent
local BodyForceController = script.Parent.Parent.Parent.BodyForceController
game.Workspace.DevSnowboard.Front:WaitForChild("BodyForce")
game.Workspace.DevSnowboard:WaitForChild("BodyForceController")
game.Workspace.DevSnowboard:WaitForChild("MovementControl")
while true do
wait()
if BodyForceController.Transparency == 0 then
while true do
wait()
print("Updating body force")
BodyForce.Force = BodyForce.Force + Vector3.new(10,0,0)
end
end
end
local BodyForce = script.Parent
local BodyForceController = script.Parent.Parent.Parent.BodyForceController
game.Workspace.DevSnowboard.Front:WaitForChild("BodyForce")
game.Workspace.DevSnowboard:WaitForChild("BodyForceController")
game.Workspace.DevSnowboard:WaitForChild("MovementControl")
while true do
wait()
if BodyForceController.Transparency == 0 then
while true do
wait()
print("Updating body force")
BodyForce.Force = BodyForce.Force*Vector3.new(10,0,0)
end
end
end
Still did not work I tried adding print functions to see if the script even worked. Here is the result
local BodyForce = script.Parent
local BodyForceController = script.Parent.Parent.Parent.BodyForceController
game.Workspace.DevSnowboard.Front:WaitForChild("BodyForce")
game.Workspace.DevSnowboard:WaitForChild("BodyForceController")
game.Workspace.DevSnowboard:WaitForChild("MovementControl")
while true do
wait()
if BodyForceController.Transparency == 0 then
while true do
wait()
print("Updating body force")
BodyForce.Force = BodyForce.Force*Vector3.new(10,0,0)
end
else print"BFC is not running"
end
end
local BodyForce = script.Parent
local BodyForceController = script.Parent.Parent.Parent.BodyForceController
game.Workspace.DevSnowboard.Front:WaitForChild("BodyForce")
game.Workspace.DevSnowboard:WaitForChild("BodyForceController")
game.Workspace.DevSnowboard:WaitForChild("MovementControl")
while true do
wait()
if BodyForceController.Transparency == 0 then
print("Updating body force")
BodyForce.Force = BodyForce.Force*Vector3.new(10,0,0)
else
print ("BFC is not running")
end
end
I don’t really know how to do that lol so that’s why I’ve been using part transparency to determine.
And the wiki for the remote events is confusing for me