of     2   
chevron_rightchevron_rightchevron_right

Hookyto
#213438981Monday, April 03, 2017 11:11 AM GMT

script.Parent.Lava.Touched:connect(function(hit) if hit:FindFirstChild("Cash") then local owner = game.Players.LocalPlayer local cash = game.Players.LocalPlayer.leaderstats.Cash if cash then cash.Value = cash.Value + hit.Cash.Value end hit:Destroy() end end) in game the dev console displays localplayer as a nil value...
edenDeden
#213439996Monday, April 03, 2017 11:31 AM GMT

u cant only use local player in a local script
edenDeden
#213440010Monday, April 03, 2017 11:31 AM GMT

can*
Hookyto
#213463334Monday, April 03, 2017 8:38 PM GMT

bump
Hookyto
#213463360Monday, April 03, 2017 8:38 PM GMT

then how would i? ive tried GetCharacterFromPlayer
Cyrakohl
#213463389Monday, April 03, 2017 8:39 PM GMT

What are you attempting to do?. #code print(string.rep("Lit",5))
Unsubtleties
#213463393Monday, April 03, 2017 8:39 PM GMT

"GetCharacterFromPlayer" Umm...
LaeMVP
#213463424Monday, April 03, 2017 8:39 PM GMT

.Touched gets the character not the player. so it would be looking for cash inside of the character model.
Cyrakohl
#213463458Monday, April 03, 2017 8:40 PM GMT

Unsub is rigtht lol. #code print(string.rep("Lit",5))
Cyrakohl
#213464022Monday, April 03, 2017 8:51 PM GMT

script.Parent.Touched:connect(function(hit) local player = game.Players:GetPlayerFromCharacter(hit.Parent) local money = player:FindFirstChild("leaderstats").money if hit:IsA(player) then money.Value = money.Value + 1 end end) #code print(string.rep("Lit",5))
Cyrakohl
#213464043Monday, April 03, 2017 8:51 PM GMT

It doesnt invoke when a ### #### it so thats a bonus. #code print(string.rep("Lit",5))
Unsubtleties
#213464055Monday, April 03, 2017 8:51 PM GMT

no
Cyrakohl
#213464259Monday, April 03, 2017 8:56 PM GMT

Woops script.Parent.Touched:connect(function(hit) local player = game.Players:GetPlayerFromCharacter(hit.Parent) local money = player:FindFirstChild("leaderstats").money if hit.Parent:IsA(player) then money.Value = money.Value + 1 end end) #code print(string.rep("Lit",5))
Unsubtleties
#213464311Monday, April 03, 2017 8:57 PM GMT

no and it'll still invoke regardless of what touches it, it's just a matter of the conditional statements evaluating to true
Cyrakohl
#213464344Monday, April 03, 2017 8:57 PM GMT

True. #code print(string.rep("Lit",5))
Xstarlight
#213464586Monday, April 03, 2017 9:02 PM GMT

Well, two things can happen. 1 You aren't using FE, so then use this: #code script.Parent.Lava.Touched:connect(function(hit) if hit.Parent.Humanoid and hit.Parent:FindFirstChild("Cash", true) then --the true in the findfirstchild function will make the function search in the childrens of the childrens of the childrens, etc until it reaches a matching name local plr = game.Players:FindFirstChild(hit.Parent.Name) local cash = plr.leaderstats.Cash if cash then cash.Value = cash.Value + hit.Cash.Value end hit:Destroy() end end) Local Player can only be used for general things like mouse icon, etc. For more specific things try what i showed you 2 You ARE using FE then: Transfer the script to server-side, best way of saying it. I would like to thank all my helpers in the forum, except you Tommy. I don't like Tommy...
Cyrakohl
#213464656Monday, April 03, 2017 9:03 PM GMT

Lol? #code print(string.rep("Lit",5))
Cyrakohl
#213464674Monday, April 03, 2017 9:03 PM GMT

Do you even know what you're talking about lol?. #code print(string.rep("Lit",5))
Xstarlight
#213464746Monday, April 03, 2017 9:05 PM GMT

I attempted, ######## Unlike you who just posts: "Lol" I would like to thank all my helpers in the forum, except you Quantum. I don't like Quantum...
Cyrakohl
#213464786Monday, April 03, 2017 9:05 PM GMT

You're script is dumb lol honestly GetPlayerFromCharacter is so much easier and more efficent. #code print(string.rep("Lit",5))
Xstarlight
#213464865Monday, April 03, 2017 9:07 PM GMT

Well, i'm sorry. I'm just trying to be helpful unlike you seems to just love messing with people. I would like to thank all my helpers in the forum, except you Quantum. I don't like Quantum...
Unsubtleties
#213464906Monday, April 03, 2017 9:07 PM GMT

You guys are overcomplicating it... OP, I don't know if `player` is supposed to already be defined. It looks like a tycoon to me. local player -- define this somehow; owner of tycoon? local cash = player.leaderstats.Cash -- no need to check; it's going to exist script.Parent.Lava.Touched:Connect(function(part) local value = part:FindFirstChild("Cash") if value then cash.Value = cash.Value + value.Value end end)
Cyrakohl
#213464929Monday, April 03, 2017 9:08 PM GMT

You're misleading him because you dont even know what you're talking about so. #code print(string.rep("Lit",5))
Unsubtleties
#213464939Monday, April 03, 2017 9:08 PM GMT

"no need to check; it's going to exist" Assuming your game is FE like it should be.
Cyrakohl
#213464950Monday, April 03, 2017 9:08 PM GMT

(I wasnt speaking to you unsub btw) #code print(string.rep("Lit",5))

    of     2   
chevron_rightchevron_rightchevron_right