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

Walk speed and jump power change doesn't apply on respawn?

Asked by 2 years ago
Edited 2 years ago

Hi, I am working on an obby game.

The game settings: Jump: 0 Walk: 0

Basically, you cannot move or jump.

01local sounds = game.Workspace.Sounds
02 
03local player = script.Parent.Parent.Parent.Parent
04 
05local TweenService = game:GetService("TweenService")
06 
07local tweenInfo = TweenInfo.new(0.2,Enum.EasingStyle.Linear)
08local SongFadeTweenInfo = TweenInfo.new(0.5,Enum.EasingStyle.Quad)
09 
10local SongFadeOut = TweenService:Create(sounds.MainMenu,SongFadeTweenInfo,{Volume=0})
11 
12 
13local button = script.Parent.Parent:WaitForChild("PlayButton")
14 
15button.MouseEnter:Connect(function()
View all 38 lines...

This is a LocalScript in StarterGUI > Frame > TextButton

This script works fine, but the WalkSpeed and JumpPower change doesn't apply on respawn. Any help is appreciated!

If you want more information, please ask. I will answer whenever I can.

0
I believe the problem of this is the game starter walk speed and jump power is at 0 so when you respawn it stays like that. How can I change that? I understand the problem, just didn't knew how to fix it krLuCiEzkr 22 — 2y

3 answers

Log in to vote
1
Answered by 2 years ago
Edited 2 years ago

Closed since I got help from another person, still appreciated.

Here is the script:

01local TweenService = game:GetService("TweenService")
02 
03local sounds = game.Workspace.Sounds
04local player = game.Players.LocalPlayer
05 
06local tweenInfo = TweenInfo.new(0.2,Enum.EasingStyle.Linear)
07local SongFadeTweenInfo = TweenInfo.new(0.5,Enum.EasingStyle.Quad)
08local SongFadeOut = TweenService:Create(sounds.MainMenu,SongFadeTweenInfo,{Volume=0})
09 
10local button = script.Parent.Parent:WaitForChild("PlayButton")
11 
12function set_speed(character, walkspeed, jumppower)
13  local humanoid = character:WaitForChild("Humanoid")
14  humanoid.WalkSpeed = walkspeed
15  humanoid.JumpPower = jumppower
View all 43 lines...

Don't know how to mark my answer as a solution, but do know that I have the script fixed.

0
put [SOLVED] or (answered) in the question title T3_MasterGamer 2189 — 2y
Ad
Log in to vote
0
Answered by 2 years ago
Edited 2 years ago

A solution to this answer would to make a datastore for your walk and jump. Here is an example of a walkspeed datastore:

01local DataStore = game:GetService("DataStoreService"):GetDataStore("SpeedData")
02 
03game.Players.PlayerAdded:Connect(function(Player)
04    local speedData = DataStore:GetAsync("WalkSpeed-"..Player.UserId)
05    local SpeedValue = Instance.new("IntValue",Player)
06    SpeedValue.Name = "PlayerSpeed"
07 
08 
09 
10    local success,error = pcall(function()
11        SpeedValue.Value = speedData
12    end)
13    if error then
14        SpeedValue.Value = 16
15    end
View all 38 lines...

This is just an example I found on the internet try making your own if you can this one may or may not work and you will probably need to set it up with your system Resource Hope this helps!!

0
You really don't need a DataStore for this. This is overengineering. T3_MasterGamer 2189 — 2y
0
Good point theking66hayday 841 — 2y
0
Is this a script in ServerScriptService? Also, it would be easier if you elaborate on what you need to do. krLuCiEzkr 22 — 2y
0
Put script is server script service hope that answers it theking66hayday 841 — 2y
Log in to vote
0
Answered by 2 years ago
Edited 2 years ago

It's so simple! All you gotta do is follow these steps:

  1. Open Roblox Studio
  2. Open the game you want to disable walk and jump.
  3. Go to the very top bar.
  4. Click Home
  5. Under Home, you will see sections of buttons.
  6. Find the Settings section, between the Test section and the Team Test section.
  7. On the Settings section, there is a button called Game Setting, and click that.
  8. On the left of the popup, you will see buttons such as Basic Info and Permissions.
  9. Find World and click it.
  10. Change Jump and "Walk* to 0.
  11. At the very bottom of the popup, click Save.
  12. Don't forget to save your game too!
0
My apologies for not elaborating, the game settings walk speed and jump power is at 0. The script purpose is to give the player walk speed and jump power back to default. However, the changes doesn't apply on respawn. (See line 32 and 33) krLuCiEzkr 22 — 2y
0
Oh, sorry for the confusion. T3_MasterGamer 2189 — 2y

Answer this question