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

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

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

1 comment

4

the error is caused by a typo. The function is called GetService

1 answer

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

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