Sayfside
(Peter)
September 24, 2021, 5:49pm
#1
Alright, so I have made something like a Golden Apple from Minecraft, it works but for some reason its not working at the same time. I have tried so many things but none of them patch it. Here is a YouTube video showing whats happening:
function MyFunctions.ConsumeItem(this)
wait(workspace)
local Tool = this.Parent.Parent
local Player = game.Players.LocalPlayer
local plrName = Player.Name
local plrWorkspace = game.Workspace:FindFirstChild(plrName)
Tool.Equipped:Connect(function(mouse)
mouse.Button2Down:Connect(function()
plrWorkspace:FindFirstChild("Humanoid").Health = plrWorkspace:FindFirstChild("Humanoid").MaxHealth
end)
end)
end
achdef
(blue)
September 24, 2021, 5:51pm
#2
Could we have a picture of the console? (F9 in test mode or /console in the chat), along with the output.
Sayfside
(Peter)
September 24, 2021, 6:03pm
#3
There is nothing in the console, I checked.
Sayfside
(Peter)
September 24, 2021, 6:03pm
#4
Nothing important. Or related to this topic.
Mystxry12
(Mystxry)
September 24, 2021, 6:04pm
#5
Could you like elaborate it a lil bit? Cuz rn i dont understand the problem.
Sayfside
(Peter)
September 24, 2021, 6:06pm
#6
Watch the video, When I right click it makes my health back to normal but then for some reason it doesnt.
achdef
(blue)
September 24, 2021, 6:07pm
#7
Okay wait. So your waiting for the workspace?? That should not happen at all, the workspace is already created when someone is on the loading screen.
Sayfside
(Peter)
September 24, 2021, 6:07pm
#8
Idk why I put that, but I just removed it and it still works
achdef
(blue)
September 24, 2021, 6:09pm
#9
I honestly have no ideas of what the issue is.
Reditect
(Reditect)
September 24, 2021, 6:09pm
#10
Is it a local script or a normal script?
achdef
(blue)
September 24, 2021, 6:10pm
#11
Actually, that is a pretty good question.
Mystxry12
(Mystxry)
September 24, 2021, 6:10pm
#12
Mayb the other Decrease health function is running after this script
achdef
(blue)
September 24, 2021, 6:10pm
#13
There isn’t any decrease health functions though?
achdef
(blue)
September 24, 2021, 6:11pm
#14
Anyways, let’s not go off-topic. @Sayfside , is it a local or serverside script?
Mystxry12
(Mystxry)
September 24, 2021, 6:11pm
#15
He didnt send it in devforum here. There prob is one script lik tht
Reditect
(Reditect)
September 24, 2021, 6:11pm
#16
You cannot use " local player " for normal server scripts. It only works for local scripts.
Sayfside
(Peter)
September 24, 2021, 6:13pm
#17
Normal, I tried a local script and it still didn’t work.
Sayfside
(Peter)
September 24, 2021, 6:14pm
#18
Not normal script, I meant module script
Sayfside
(Peter)
September 24, 2021, 6:15pm
#19
Also I have to go rn, but Ill be back in a few hours
Mystxry12
(Mystxry)
September 24, 2021, 6:15pm
#20
Did you stop decreasing the plrs health after the gainhealth script runs?