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

Im trying to create a simulator sell script need a bit of help with it (?)

Asked by 6 years ago
Edited 6 years ago

So im just trying to improve my scripting by creating games and this is a simulator game im trying to make just to gain some more experience the script is working but it wont multiply by the multiplier int value that i have in the player

local parent = script.Parent

parent.Touched:Connect(function(part)
local mark = part.Parent:FindFirstChild("Humanoid")
local player = game.Players:GetPlayerFromCharacter(part.Parent)
    if mark then
        player.leaderstats.Coins.Value = player.leaderstats.Coins.Value + player.leaderstats.Sand.Value * player.Values.Multiplier.Value
        player.leaderstats.Sand.Value = player.leaderstats.Sand.Value - player.leaderstats.Sand.Value   
    end     
end)

ik my scripts are messy its just a bad habit i have

0
Line 08 sets their sand value to 0, I don't know if that's intended, but you can write it as = 0 //Additionally you should probably switch line 6 and line 5, as it won't find a player if there's no Humanoid anyway. // Are you sure there's a Values.Multiplier value in the player? Is there any output? clc02 553 — 6y
0
Yes i am sure there is a values.multiplier value in the player and no there isnt anything in the output i just figured out the problem its because it adds 0.50 to the multiplier and looks like roblox doesnt support frictional values im searching for an answer for that jovkon123 17 — 6y
0
When it gets to a integer like 2 it works then continues with 2 untill it gets to 3 and so on idk whats the problem here jovkon123 17 — 6y

Answer this question