Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Comet |
(Sorry for my english i’m using google translator)
I got this error “Invalid type in built-in function ‘store_string’ in base” _File “. Cannot convert argument 1 from float to String.”
extends Node
var experion = 0
var hp = 100
var level = 0
var your_exp = 0
var sf = File.new()
const gamedata = 'user://gamedata.txt'
func save():
sf.open(gamedata, File.WRITE)
sf.store_string(hp)
sf.close()
pass
func load():
print('loaded')
sf.open(gamedata, File.READ)
hp = sf.get_as_text()
sf.close()
pass