Introduction
Hello! So I’m trying to make a platformer and adventure game! I’m trying to make a game similar to Super Mario 64, ( Basically trying to make my own Mario themed type game. ) I’m trying to make keybinds/controls that will be like SM64 all of these:
SM64 Controls
Use These 2 For Reference
Super Mario 64 Speedrun Movement Guide - YouTube
Controls of SM64 that I'm trying to Replicate
While running, quickly turn around + : Sideways Somersault
Upon hitting a wall, : Wall Jump
→ upon landing: Double Jump
→ → : Triple Jump (while running); lift off (wearing the Wing Cap)
→ : Jump Kick (from a standstill); Midair Dive (while running)
→ → : Punch → Punch → Kick
In midair, : Ground Pound
- : Crawl
- : Backwards Somersault (from a standstill); Long Jump (while running)
- : Sweep Kick (from a standstill); Slide Kick (while running)
The above text is from the Super Mario Wiki and is available under a Creative Commons license. Attribution must be provided through a list of authors or a link back to the original article. Source: Super Mario 64 - Super Mario Wiki, the Mario encyclopedia
The issue is, when I was trying to make the long jump, I was trying to track down what state the player is in, so like for an e.g, ( If player.State = running and Key.LeftShift.Down = true and Key.Space.Down = true then > LongJump() ) Same for all of the other controls like a Backwards Sumorsaw
The Issue
For some reason, In my script that was re-created and edited by @weegismrts ( Thanks for that )
when I started trying to make it so it would check the players state then this is what happened:
The Output
11:25:07.520 Workspace.FallDamageScript:25: Incomplete statement: expected assignment or a function call - Studio - FallDamageScript:25
11:25:20.862 State is not a valid member of Humanoid "Workspace.NubblyFry.Humanoid" - Client - LongJump:42
11:25:20.863 Stack Begin - Studio
11:25:20.864 Script 'Workspace.NubblyFry.LongJump', Line 42 - Studio - LongJump:42
11:25:20.864 Stack End - Studio
11:25:21.678 0.5, 0.5 - Server
11:25:21.915 0.5, 0.5 - Client
11:29:31.839 Super Oofy 64 auto-recovery file was created - Studio - C:/Users/mrtix/OneDrive/Documents/ROBLOX/AutoSaves
The Script
local canBoost = true
local UIS = game:GetService("UserInputService")
local c = script.Parent
local LeftShiftInDown = false
local Anim = c.Humanoid:LoadAnimation(game.ReplicatedStorage.LongJumpAnim)
function VelocityFunction()
if canBoost then
canBoost = false
local V = Instance.new("BodyVelocity", c.HumanoidRootPart)
V.MaxForce = Vector3.new(40000,0,40000)
V.Velocity = c.HumanoidRootPart.CFrame.LookVector * 100
c.Humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
Anim:Play()
wait(.25)
c.HumanoidRootPart.CFrame = c.HumanoidRootPart.CFrame + Vector3.new(0,-0.02,0)
wait(.8)
Anim:Stop()
V:Destroy()
canBoost= true
end
end
UIS.InputBegan:Connect(function(key,chat)
if key.KeyCode == Enum.KeyCode.LeftShift then
LeftShiftInDown = true
end
end)
UIS.InputEnded:Connect(function(key,chat)
if key.KeyCode == Enum.KeyCode.LeftShift then
LeftShiftInDown = false
end
end)
UIS.InputBegan:Connect(function(key,chat)
if key.KeyCode == Enum.KeyCode.Space and LeftShiftInDown and c.Humanoid:State(Enum.HumanoidStateType.Running) then
VelocityFunction()
end
end)
-- I Recommend reading the Introduction to The Script so you can get a better understanding of what Im trying to create.