|
--I'm sorry if i post too much. i just love making games.
game.Players.LocalPlayer.CharacterAdded:wait()
thingy = 1
while true do
thingy = script.Parent:WaitForChild("Waste").Value
if game.Players.LocalPlayer.leaderstats.Hunger.Value == 0 then
game.Players.LocalPlayer.Character.Humanoid.Health = game.Players.LocalPlayer.Character.Humanoid.Health - 1
wait(0.1)
elseif game.Players.LocalPlayer.Character.Humanoid.Health == 0 then
wait()
else
game.Players.LocalPlayer.leaderstats.Hunger.Value = game.Players.LocalPlayer.leaderstats.Hunger.Value - thingy
game.Players.LocalPlayer.Character.Humanoid.JumpPower = game.Players.LocalPlayer.leaderstats.Hunger.Value*0.5
wait(3)
end
end
--Located in SCREENGUI--
-- extra info
-- i made a hunger fixing script too. that one doesnt work too.
--ANOTHER LOCALSCRIPT INSIDE THE LOCALSCRIPT--
player = game.Players.LocalPlayer
function onchange()
if player.leaderstats.Hunger.Value >= 100 then
player.leaderstats.Hunger.Value = 100
end
end
player.leaderstats.Hunger.Changed:connect(onchange)
--TL;DR these 2 scripts work in studio finely but ingame break. |
|
|
NOEDIT : Waste.Value changes with this script in screengui too
-- insanityscripter
--Drag this script into the StarterGui folder.
repeat wait() until game.Players.LocalPlayer
m = game.Players.LocalPlayer:GetMouse()
m.KeyDown:connect(function(key)
if key == "0" then --"Shift to run" 0 == shift
script.Parent.Waste.Value = 3
print("Running")
game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 25 --change "25" to your speed you want
end
end)
m.KeyUp:connect(function(key)
if key == "0" then
script.Parent.Waste.Value = 1
game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 16 --change "16" to your speed you want when you stop running
end
end) |
|
|
Bump EDIT : i guess i could put the hunger script somewhere else? |
|
|
Bump 2 edit : doesn't work. |
|
|
|
its a localscript isnt it
does your game have filteringenabled
https://www.youtube.com/watch?v=onhFH7jpq2c |
|
|
FilteringEnabled disabled
localscript |
|
|
Edit : should i use modulescript? |
|
|
|
|
|
|
How do i see the output???? |
|
|
Press F9 while in game to open output. |
|
|
Random number values only. What to do? |
|
|
|
bump2. tried every every everything i could. still broken :( |
|
indeimausJoin Date: 2014-09-01 Post Count: 4285 |
use game:GetService("Players").LocalPlayer |
|