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

GetServive is not a valid member of DataModel "IMMATRIX_SAMMYYT130's Place Number: 27?"

Asked by 3 years ago
Edited by imKirda 3 years ago

And here is my script

local buy = script.Parent
local ReplicatedStorage = game:GetServive('ServerScriptService')
local canBuy = true
local sellPrice = 50

local function buy_Dropper(otherPart)
    local player = game.Players.GetPlayerFromCharacter(otherPart.Parent)
    local playerCandies = player.leaderstats.Candies 
    if player and playerCandies.Value > sellPrice and canBuy then
        canBuy = false
        playerCandies.Value = playerCandies.Value - sellPrice
        local Dropper = ReplicatedStorage:FindFirstChild("Dropper")
        Dropper.Sell.Value = sellPrice/2
        local newDropper = Dropper:Clone()
        newDropper.Parent = game.Workspace
        newDropper:SetPrimaryPartCFrame(buy.CFrame + Vector3.new(0,0,1))
        newDropper.Name = player.Name
        buy:Destroy()
    end 
end

buy.Touched:Connect(buy_Dropper)

put your code in a block, blue Lua icon in the editor

4
the error is caused by a typo. The function is called GetService bluzorro 417 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

There is a typo. It should be GetService instead on GetServive

Ad

Answer this question