Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

I'm getting errors from my script even after checking that it is correct. Any help?

My serverscript that gives money after touching a block doesn't seem to be working. Can I have a bit of help? It's pretty simple.

script.Parent.Touched:Connect(function(hit)
	if hit.Parent:FindFirstChild("Humanoid") then
		local name = hit.Parent.Name --ust normal variables to use for later
		local character = hit.Parent --just normal variables to use for later
		--give them money
		game.Players[name].leaderstats.Cash.Value + 15
	end
end)

Thank you!

2 answers

✓ Accepted answer

You need to give the code what to do with that value you just generated:

script.Parent.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") then
        local name = hit.Parent.Name --ust normal variables to use for later
        local character = hit.Parent --just normal variables to use for later
        --give them money
        game.Players[name].leaderstats.Cash.Value = game.Players[name].leaderstats.Cash.Value + 15
    end
end)

2 comments

0

wow... really leamir...

0

wow- thanks!

Try This! So i have to give an explanation, due to Leamir telling me to do so.. Well.. I think to get a Players name, you have got to state their username or get it. i do so like this game.Players.Name Your welcome!


script.Parent.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") then
        local name = hit.Parent.Name --ust normal variables to use for later
        local character = hit.Parent --just normal variables to use for later
        --give them money
        game.Players.Name.leaderstats.Cash.Value + 15
    end
end)

19 comments

0

Oh sorry Leamir..

0

how can you be so sure it was me? There're others community moderators

0

Because your the strictest one dude.. youve supspended my brother twice.

0

I can't suspend anyone, I can only moderate questions and answers

0

When you downvote it.. then it makes their reputation go so low, they get banned. You’ve done that several times to people.

0

Sometimes just let it go, let it slide man...

0

when I add a moderation claim to a question, it automatically removes reputation from the users, I can't do nothing about it

0

You could let it slide? They are still learning, if they lose all their reputation, how are they going to learn afterwards?

0

You normally don't get a too low reputation in one post, if your question gets closed, you should read the rules

0

I have read and studied, through all my time on this site, it has only been you downvoting my posts or questions, leaving me discouraged and left in pity.. how do you think the new other scripters feel.. i bet they feel like they dont ever want to come back ever again.

0

I am "goodlead" and "JuxedIX" on this site. And you Leamir are the reason on have gotten banned on both accounts. You are saying that you don't lose so many rep when moderated, well I have lost -50 rep+ and got banned just because of you, here is the proof.

0

I don't have access to those files

0

He’ll grant it.

0

Message me on discord if you want to directly talk to me Leamir#9484

0

@iivSnooxy Leamir is embarresed to answer us

0

Nah, i”m good, i won’t go all the way to Discord to argue.

0

@Leamir now you should have access

This discussion is preserved as it was. New answers, comments, and votes are closed.